home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MPW 411 / MPWHelp < prev    next >
Encoding:
Text File  |  1991-04-08  |  364.5 KB  |  10,428 lines  |  [TEXT/MPS ]

  1. æKY CopyrightNotice
  2. æC  Copyright Apple Computer, Inc. 1986-1991, All rights reserved.
  3. 411 - MPW Help - MPW 3.2 Final Release.
  4. Thursday, April 4, 1991 11:53:46 AM
  5.  
  6. MPW 3.2 Help Summaries
  7.  Help information is available for each of the MPW commands.  
  8.  To see the list of commands select Help and type command - 1. In addition, 
  9.  brief descriptions of Expressions, Patterns, Selections, Characters,
  10.  Shortcuts, Variables, and Projector are also included.
  11.  
  12.  To see Help summaries, Select one of the following and type command - 1
  13.  
  14.  a commandName  # information about commandName
  15.  Commands       # a list of commands
  16.  Expressions    # summary of expressions
  17.  Patterns       # summary of patterns (regular expressions)
  18.  Selections     # summary of selections
  19.  Characters     # summary of MPW Shell special characters
  20.  Shortcuts      # summary of MPW Shell shortcuts
  21.  Variables      # summary of the standard MPW shell variables
  22.  Projector      # summary of Projector, a project/source control system
  23.  
  24.  Copyright Apple Computer, Inc. 1986-1990
  25.  All rights reserved.
  26.  
  27. æKY Commands
  28. æC              MPW Commands -- A list of MPW executable commands
  29.  
  30.  AddMenu         # add a menu item
  31.  AddPane         # split the window into panes
  32.  Adjust          # adjust lines
  33.  Alert           # display an alert box
  34.  Alias           # define or write command aliases
  35.  Align           # align text to left margin
  36.  Asm             # MC68xxx Macro Assembler
  37.  Backup          # folder file backup
  38.  Beep            # generate tones
  39.  Begin           # group commands
  40.  Break           # break from For or Loop
  41.  Browser         # invoke Marker Browser
  42.  BuildCommands   # show build commands
  43.  BuildMenu       # create the Build menu
  44.  BuildProgram    # build the specified program
  45.  C               # C compiler
  46.  Canon           # canonical spelling tool
  47.  Catenate        # concatenate files
  48.  CFront          # C++ to C translator
  49.  CheckIn         # check a file into a project
  50.  CheckOut        # check a file out from a project
  51.  CheckOutDir     # specify the directory where checked out files will placed
  52.  Choose          # choose or list network file server volumes and printers
  53.  Clear           # clear the selection
  54.  Close           # close specified windows
  55.  CMarker         # generate Mark commands for C and C++ function definitions
  56.  Commando        # present a dialog interface for commands
  57.  Compare         # compare text files
  58.  CompareFiles    # compare text files and interactively view differences
  59.  CompareRevisions# compare two revisions of a file in a project
  60.  Confirm         # display a confirmation dialog box
  61.  Continue        # continue with next iteration of For or Loop
  62.  Copy            # copy selection to Clipboard
  63.  Count           # count lines and characters
  64.  CPlus           # script to compile C++ source
  65.  CreateMake      # create a simple makefile
  66.  Cut             # copy selection to Clipboard and delete it
  67.  Date            # write the date and time
  68.  Delete          # delete files and directories
  69.  DeleteMenu      # delete user-defined menus and menu items
  70.  DeleteNames     # delete user-defined symbolic names
  71.  DeletePane      # delete panes from the window
  72.  DeleteRevisions # delete previous revisions of files in a project
  73.  DeRez           # resource decompiler
  74.  Directory       # set or write the default directory
  75.  DirectoryMenu   # create the Directory menu
  76.  DoIt            # highlight and execute a series of shell commands
  77.  DumpCode        # write formatted CODE resources
  78.  DumpFile        # display contents of any file
  79.  DumpObj         # write formatted object file
  80.  Duplicate       # duplicate files and directories
  81.  Echo            # echo parameters
  82.  Eject           # eject volumes
  83.  Entab           # convert runs of spaces to tabs
  84.  Equal           # compare files and directories
  85.  Erase           # initialize volumes
  86.  Evaluate        # evaluate an expression
  87.  Execute         # execute command file in the current scope
  88.  Exists          # confirm the existence of a file or directory
  89.  Exit            # exit from a command file
  90.  Export          # make variables available to commands
  91.  FileDiv         # divide a file into several smaller files
  92.  Files           # list files and directories
  93.  Find            # find and select a text pattern
  94.  Flush           # flush the tools that the Shell has cached
  95.  For             # repeat commands once per parameter
  96.  Format          # set or display formatting options for a window
  97.  Get             # get information about a key word from a data file
  98.  GetErrorText    # display error messages based on message number
  99.  GetFileName     # display a Standard File dialog box
  100.  GetListItem     # display items for selection in a dialog box
  101.  Help.MPW        # write summary information
  102.  If              # conditional command execution
  103.  Lib             # combine object files into a library file
  104.  Line            # find line in the target window
  105.  Link            # link an application, tool, or resource
  106.  Loop            # repeat commands until Break
  107.  Make            # build up-to-date version of a program
  108.  MakeErrorFile   # create error message textfile
  109.  Mark            # assign a marker to a selection
  110.  Markers         # list markers
  111.  MatchIt         # semi-intelligent language sensitive bracket matcher
  112.  MergeBranch     # merge a branch revision onto the trunk
  113.  ModifyReadOnly  # enables a read-only Projector file to be edited
  114.  Mount           # mount volumes
  115.  MountProject    # mount projects
  116.  Move            # move files and directories
  117.  MoveWindow      # move window to h,v location
  118.  NameRevisions   # define a symbolic name
  119.  New             # open a new window
  120.  Newer           # compare modification dates of files
  121.  NewFolder       # create a new folder
  122.  NewProject      # create a new project
  123.  Open            # open file(s) in window(s)
  124.  OrphanFiles     # remove Projector information from a list of files
  125.  Parameters      # write parameters
  126.  Pascal          # Pascal compiler
  127.  PasMat          # Pascal programs formatter
  128.  PasRef          # Pascal cross-referencer
  129.  Paste           # replace selection with Clipboard contents
  130.  PerformReport   # generate a performance report
  131.  Position        # display current line position
  132.  Print           # print text files
  133.  ProcNames       # display Pascal procedure and function names
  134.  Project         # set or write the current project
  135.  ProjectInfo     # display information about a Project
  136.  Quit            # quit MPW
  137.  Quote           # echo parameters, quoting if needed
  138.  Rename          # rename files and directories
  139.  Replace         # replace the selection
  140.  Request         # request text from a dialog box
  141.  ResEqual        # compares the resources in two files
  142.  Revert          # revert window to previous saved state
  143.  Rez             # resource compiler
  144.  RezDet          # detect inconsistencies in resources
  145.  RotateWindows   # send active (frontmost) window to back
  146.  Save            # save specified windows
  147.  SaveOnClose     # set save behavior when closing windows
  148.  Search          # search files for pattern
  149.  Set             # define or write Shell variables
  150.  SetDirectory    # set the default directory
  151.  SetFile         # set file attributes
  152.  SetPrivilege    # set access privileges for directories on file servers
  153.  SetVersion      # maintain version and revision number
  154.  Shift           # renumber command file positional parameters
  155.  ShowSelection   # place the selection within an editor window
  156.  Shutdown        # power down or restart the machine
  157.  SizeWindow      # set a window's size
  158.  Sort            # sort or merge lines of text
  159.  StackWindows    # arrange windows diagonally
  160.  StreamEdit      # scriptable text editor
  161.  Target          # make a window the target window
  162.  TileWindows     # arrange windows in a tiled fashion
  163.  TransferCkid    # move Projector information from one file to another
  164.  Translate       # translate characters
  165.  Unalias         # remove aliases
  166.  Undo            # undo the last edit
  167.  Unexport        # remove variable definitions from the export list
  168.  Unmark          # remove a marker from a window
  169.  Unmount         # unmount volumes
  170.  UnmountProject  # unmount projects
  171.  Unset           # remove Shell variable definitions
  172.  UserVariables   # uses Commando to set all the user variables
  173.  Version         # print the version of the MPW Shell
  174.  Volumes         # list mounted volumes
  175.  WhereIs         # find the location of a file
  176.  Which           # determine which file the shell will execute
  177.  Windows         # list windows
  178.  ZoomWindow      # enlarge or reduce a window's size
  179.  
  180. æKY Help
  181. MPWHelp
  182.  
  183. æKL About411
  184. Characters
  185. Commands
  186. Expressions
  187. Patterns
  188. Projector
  189. Selections
  190. Shortcuts
  191. Variables
  192.  
  193. AddMenu
  194. AddPane
  195. Adjust
  196. Alert
  197. Alias
  198. Align
  199. Asm
  200. Backup
  201. Beep
  202. Begin
  203. Break
  204. BuildCommands
  205. BuildMenu
  206. BuildProgram
  207. C
  208. Canon
  209. Catenate
  210. CFront
  211. CheckIn
  212. CheckOut
  213. CheckOutDir
  214. Choose
  215. Clear
  216. Close
  217. CMarker
  218. Commando
  219. Compare
  220. CompareFiles
  221. CompareRevisions
  222. Confirm
  223. Continue
  224. Copy
  225. Count
  226. CPlus
  227. CreateMake
  228. Cut
  229. Date
  230. Delete
  231. DeleteMenu
  232. DeleteNames
  233. DeletePane
  234. DeleteRevisions
  235. DeRez
  236. Directory
  237. DirectoryMenu
  238. DoIt
  239. DumpCode
  240. DumpFile
  241. DumpObj
  242. Duplicate
  243. Echo
  244. Eject
  245. Entab
  246. Equal
  247. Erase
  248. Evaluate
  249. Execute
  250. Exists
  251. Exit
  252. Export
  253. FileDiv
  254. Files
  255. Find
  256. Flush
  257. For
  258. Format
  259. Get
  260. GetErrorText
  261. GetFileName
  262. GetListItem
  263. Help.MPW
  264. If
  265. Lib
  266. Line
  267. Link
  268. Loop
  269. Make
  270. MakeErrorFile
  271. Mark
  272. Markers
  273. MatchIt
  274. MergeBranch
  275. ModifyReadOnly
  276. Mount
  277. MountProject
  278. Move
  279. MoveWindow
  280. NameRevisions
  281. New
  282. Newer
  283. NewFolder
  284. NewProject
  285. Open
  286. OrphanFiles
  287. Parameters
  288. Pascal
  289. PasMat
  290. PasRef
  291. Paste
  292. PerformReport
  293. Position
  294. Print
  295. ProcNames
  296. Project
  297. ProjectInfo
  298. Quit
  299. Quote
  300. Rename
  301. Replace
  302. Request
  303. ResEqual
  304. Revert
  305. Rez
  306. RezDet
  307. RotateWindows
  308. Save
  309. SaveOnClose
  310. Search
  311. Set
  312. SetDirectory
  313. SetFile
  314. SetPrivilege
  315. SetVersion
  316. Shift
  317. ShowSelection
  318. Shutdown
  319. SizeWindow
  320. Sort
  321. StackWindows
  322. StreamEdit
  323. Target
  324. TileWindows
  325. TransferCkid
  326. Translate
  327. Unalias
  328. Undo
  329. Unexport
  330. Unmark
  331. Unmount
  332. UnmountProject
  333. Unset
  334. UserVariables
  335. Version
  336. Volumes
  337. WhereIs
  338. Which
  339. Windows
  340. ZoomWindow
  341. æKY Variables
  342. æC                  Variables defined by the MPW Shell:
  343.  
  344.  {Active}          full pathname of current active window
  345.  {Aliases}         list of all defined aliases
  346.  {Boot}            volume name of the boot disk
  347.  {Command}         full pathname of the last command executed
  348.  {MPW}             full pathname of the Macintosh Programmer's Workshop.
  349.  {ShellDirectory}  full pathname of the directory that contains the MPW Shell
  350.  {Status}          result of the last command executed (0 means successful)
  351.  {SystemFolder}    full pathname of the system folder
  352.  {Target}          full pathname of the target window
  353.  {User}            the current user name (initialized to the "Chooser" name)
  354.  {Windows}         list of current windows     
  355.  {Worksheet}       full pathname of the Worksheet window
  356.  
  357.  Variables used by the MPW Shell:
  358.  
  359.  {Commando}        name of the commando tool
  360.  {Commands}        list of directories to search for commands
  361.  {DirectoryPath}   list of common directories to speed changing directories
  362.  {Echo}            control the echoing of commands to diagnostic output
  363.  {Exit}            control script termination based on {Status}
  364.  {IgnoreCmdPeriod} control use of cmd-. during critical sections
  365.  {HideHelpKey}     deactivate "help" key on extended keyboard
  366.  {Test}            control execution of tools and applications
  367.  {AutoIndent}      auto indent setting used for new windows
  368.  {CaseSensitive}   control case sensitivity for searching
  369.  {Font}            font used for new windows
  370.  {FontSize}        font size used for new windows
  371.  {NewWindowRect}   window rectangle used for new windows (top,left,bottom,right)
  372.  {PrintOptions}    options used by the print menu commands
  373.  {SearchBackward}  control direction of searching
  374.  {SearchType}      control type of searching (literal/word/expression)
  375.  {SearchWrap}      control wrap-around search
  376.  {StackOptions}    options used by the Stack Windows menu command
  377.  {Tab}             tab size used for new windows
  378.  {TileOptions}     options used by the Tile Windows menu command
  379.  {WordSet}         set of characters that constitue a word
  380.  {ZoomWindowRect}  window rectangle used for a zoomed window (top,left,bottom,right)
  381.  
  382.  Variables automatically set before script execution:
  383.  
  384.  {0}               name of the currently executing script
  385.  {1}, {2}, … {n}   first, second, and nth parameter to the script
  386.  {#}               number of parameters
  387.  {Parameters}      equivalent to {1} {2} … {n}
  388.  {"Parameters"}    equivalent to "{1}" "{2}" … "{n}"
  389.  
  390.  Variables used for libraries and include files:
  391.  
  392.  {AIncludes}       directories to search for assemby-language include files        
  393.  {CIncludes}       directories to search for C include files
  394.  {CLibraries}      directory containing C library files
  395.  {Libraries}       directory containing shared library files
  396.  {PInterfaces}     directory containing Pascal interface files
  397.  {PLibraries}      directory containing Pascal library files
  398.  {RIncludes}       directory containing Rez include files
  399.  
  400. æKY Characters
  401. æC   The characters listed below have special meanings in the command language.
  402.  
  403.  
  404.  Space           Space separates words.
  405.  Tab             Tab also separates words.
  406.  
  407.  Return          Return separates commands.
  408.  ;               Semicolon also separates commands.
  409.  |               Pipe separates commands and pipes output to input.
  410.  &&              And separates commands, executing second if first succeeds.
  411.  ||              Or separates commands, executing second if first fails.
  412.  (…)             Parenthesis group commands.
  413.                  Parenthesis also group characters in filename patterns.
  414.  
  415.  #               Comment begins comments.
  416.  
  417.  ∂               Escape (Option-D) quotes the following character.
  418.  '…'             Single quote quotes all other characters.
  419.  "…"             Double quote quotes all characters except ∂, {, and `.
  420.  /…/             Slash quotes all characters except ∂, {, and `.
  421.  \…\             Backslash quotes all characters except ∂, {, and `.
  422.  
  423.  {…}             Braces denote variable substitution.
  424.  `…`             Backquotes denote command substitution.
  425.  
  426.  ?               Question mark matches any character in filename patterns.
  427.  ≈               Approximately (Option-X) matches any string in patterns.
  428.  […]             Brackets enclose character sets in filename patterns.
  429.  *               Star indicates zero or more repetitions in patterns.
  430.  +               Plus indicates one or more repetitions in patterns.
  431.  «…»             European quotes (Option-\ and Option-Shift-\) enclose
  432.                  repeat counts.
  433.  
  434.  <               Less-than indicates an input file specification.
  435.  >               Greater-than indicates an output file specification.
  436.  >>              Indicates appending to an output file specification.
  437.  ≥               Greater-than-or-equal indicates a diagnostic specification.
  438.  ≥≥              Indicates appending to a diagnostic file specification.
  439.  ∑               Capital sigma (option-w) indicates both an output file and
  440.                  diagnostic output file specification.
  441.  ∑∑              Indicates appending to the output and diagnostic file
  442.                  specification.
  443.  
  444.  …               Elipsis (Option-;) signals the Shell to use Commando
  445.  
  446. æKY Expressions
  447. æC  Expressions
  448.  
  449.  Numbers may be expressed in decimal, hexadecimal, octal, or
  450.  binary.  Any of the following formats may be used:
  451.  
  452.  [0-9]+          decimal number
  453.  0x[0-9a-f]+     hexadecimal number
  454.  $[0-9a-f]+      hexadecimal number
  455.  0[0-7]+         octal number
  456.  0b[01]+         binary number
  457.  
  458.  The operators listed below are used in expressions in the
  459.  Evaluate, If, Else If, Break, Continue, and Exit commands. 
  460.  
  461.  Alternate spellings of several operators are provided.
  462.  All of the operators are evaluated from left to right.
  463.  Operators with the highest precedence are listed first,
  464.  and operators in the same group have equal precedence.
  465.  
  466.  
  467.  (…)             expression grouping
  468.  
  469.  -               unary negation
  470.  ~               bitwise negation
  471.  !    NOT  ¬     logical NOT (¬ is Option-L)
  472.  
  473.  *               multiplication
  474.  ÷    DIV        division (÷ is Option-/)
  475.  %    MOD        modulus division
  476.  
  477.  +               addition
  478.  -               subtraction
  479.  
  480.  <<              shift left
  481.  >>              shift right
  482.  
  483.  <               less than
  484.  <=   ≤          less than or equal to (≤ is Option-<)
  485.  >               greater than
  486.  >=   ≥          greater than or equal to (≥ is Option->)
  487.  
  488.  ==              equal
  489.  !=   <>   ≠     not equal (≠ is Option-=)
  490.  =~              equal to a pattern
  491.  !~              not equal to a pattern
  492.  
  493.  &               bitwise AND
  494.  
  495.  ^               bitwise XOR
  496.  
  497.  |               bitwise OR
  498.  
  499.  &&   AND        logical AND
  500.  
  501.  ||   OR         logical OR
  502.  
  503. æKY Selections
  504. æC      Selections - selections specify a selection or insertion point
  505.  
  506.  §                    current selection (Option-6)
  507.  n                    line number n
  508.  !n                   line n lines after end of current selection
  509.  ¡n                   line n lines before start of selection (Option-1)
  510.  position             position (defined below)
  511.  markerName           selection marked by markerName
  512.  pattern              pattern  (defined below)
  513.  (selection)          selection grouping
  514.  selection:selection  both selections and everything in between
  515.  
  516. position - positions specify an insertion point
  517.  
  518.  •                    position before first character of file (Option-8)
  519.  ∞                    position after last character of file (Option-5)
  520.  Δselection           position before first character of selection (Option-J)
  521.  selectionΔ           position after last character of selection (Option-J)
  522.  selection!n          position n characters after selection
  523.  selection¡n          position n characters before selection (Option-!)
  524.  
  525. pattern - patterns specify characters to be matched
  526.  
  527.  /entireRE/           regular expression - search forward
  528.  \entireRE\           regular expression - search backward
  529.  
  530.  Help Patterns           # See "Help Patterns" for more information.
  531.  
  532. æKY Patterns
  533. æC  Patterns - Patterns specify characters to be matched
  534.  /entireRE/           regular expression - search forward
  535.  \entireRE\           regular expression - search backward
  536.  
  537. entireRE
  538.  
  539.  •RE                  regular expression at beginning of line (Option-8)
  540.  RE∞                  regular expression at end of line (Option-5)
  541.  RE                   regular expression
  542.  
  543. RE
  544.  
  545.  simpleExpr           simple regular expression - defined below
  546.  (RE)®digit           tagged RE - refer to match as ®digit (Option-R)
  547.  'string'             literal - no characters within '…' are special
  548.  "string"             literal - only ∂, {, and ` are special within "…"
  549.  RE1RE2               regular expression RE1 followed by RE2
  550.  
  551. simpleExpr
  552.  
  553.  (RE)                 regular expression grouping
  554.  charExpr             single character regular expression - defined below
  555.  simpleExpr*          simple expression zero or more times
  556.  simpleExpr+          simple expression one of more times
  557.  simpleExpr«n»        simple expression n times (Option-\, Option-Shift-\)
  558.  simpleExpr«n,»       simple expression at least n times
  559.  simpleExpr«n1,n2»    simple expression at least n1, at most n2 times
  560.  
  561. charExpr
  562.  
  563.  character            character (unless it has special meaning)
  564.  ∂character           character - defeats any special meaning (Option-D)
  565.  ?                    any character except Return
  566.  ≈                    zero or more characters, except Return (Option-X)
  567.  [charList]           any character in the list
  568.  [¬charList]          any character not in the list (Option-L)
  569.  
  570. charList
  571.  
  572.  [                    [ first in the list represents itself
  573.  ]                    ] first in the list represents itself
  574.  -                    - first in the list represents itself
  575.  character            character
  576.  charList character   list of characters
  577.  character-character  character range (e.g. A-Z)
  578.  
  579. æKY ShortCuts
  580. æC   The following is a list of MPW Shell shortcuts:
  581.  
  582.     Double click        select word
  583.     Triple click        select line
  584.     Double Clicking on any of the characters (,),[,],{,},',",/,\,` will select
  585.     everything between the character and its mate.
  586.  
  587.     UpArrow             move insertion point one line above current position
  588.     DownArrow           move insertion point one line below current position
  589.     RightArrow          move insertion point one character to the right
  590.     LeftArrow           move insertion point one character to the left
  591.  
  592.  
  593.     Opt-LeftArrow       move insertion point one word to the left
  594.     Opt-RightArrow      move insertion point one word to the right
  595.     Cmd-UpArrow         move insertion point up one screen size
  596.     Cmd-DownArrow       move insertion point down one screen size
  597.     Cmd-RightArrow      move insertion point to end of current line
  598.     Cmd-LeftArrow       move insertion point to beginning of current line
  599.     Cmd-Opt-UpArrow     move insertion point to beginning of file
  600.     Cmd-Opt-DownArrow   move insertion point to end of file
  601.  
  602.     For the above eight shortcuts, use of the Shift key changes the action
  603.     from "move" to "extend selection."  E.g., Cmd-Shift-Opt RightArrow means
  604.     "extend selection to end of line."
  605.  
  606.     Delete              delete character to the left
  607.     Clear               delete character to the right
  608.     Opt-Delete          delete word to the left
  609.     Opt-Clear           delete word to the right
  610.     Cmd-Delete          delete from current position to end of line
  611.     Cmd-Clear           delete from current position to beginning of line
  612.     Cmd-Opt-Delete      delete from current position to end of file
  613.     Cmd-OptClear        delete from current position to beginnning of file
  614.  
  615.     Searching shortcuts
  616.         Cmd-Shift-G     reverse the direction of "Find Same"
  617.         Cmd-Shift-H     reverse the direction of "Find Selection"
  618.         Cmd-Shift-T     reverse the direction of "Replace Same"
  619.         Holding down Shift while selecting OK will reverse the direction
  620.             of "Find" and "Find and Replace"
  621.  
  622.     Holding down Option while selecting "Tile Windows" or "Stack Windows"
  623.         will include the worksheet in the tiling or stacking
  624.     Holding down Option while pressing Return will disable auto-indent
  625.         for that line.
  626.     Holding down Option while pressing Enter will invoke Commando on that
  627.         command line.
  628.  
  629.     In Dialogs without an EditText item
  630.         Y              Yes
  631.         N              No
  632.         CMD .          Cancel
  633.         ESC            Cancel
  634.  
  635. æKY Projector
  636. æC   Projector is a collection of built–in MPW commands and windows that
  637.  help programmers (both individuals and teams) control and account for
  638.  changes to all the files (documentation, source, applications etc.)
  639.  associated with a software project.
  640.  
  641.  Here is a brief summary of the commands (the CheckIn, CheckOut, and
  642.  NewProject commands also have windows that can be opened using the
  643.  "-w" option to the respective command):
  644.  
  645.  CheckIn          # check a file into a project
  646.  CheckOut         # check a file out from a project
  647.  CheckOutDir      # specify the directory where checked out files will placed
  648.  CompareRevisions # compare two revisions of a file in a project
  649.  DeleteNames      # delete user-defined symbolic names
  650.  DeleteRevisions  # delete previous revisions of files in a project
  651.  MergeBranch      # merge a branch revision onto the trunk
  652.  ModifyReadOnly   # enables a read-only Projector file to be edited
  653.  MountProject     # mount projects
  654.  NameRevisions    # define a symbolic name
  655.  NewProject       # create a new project
  656.  OrphanFiles      # remove Projector information from a list of files
  657.  Project          # set or write the current project
  658.  ProjectInfo      # display information about a Project
  659.  TransferCkid     # move Projector information from one file to another
  660.  UnmountProject   # unmount projects
  661.  
  662.                              Examples
  663.  
  664.   The command
  665.  
  666.   Project
  667.  
  668.   causes the current project name to be written to standard output.
  669.   To change the current project to OurProject, use
  670.  
  671.   Project OurProject
  672.  
  673.  
  674.                              See also 
  675.  
  676.   NewProject, MountProject.
  677.  
  678.  
  679. æKY About411
  680. æC         
  681. About "411"
  682. "411" provides a way for Macintosh developers to achieve rapid retrieval of software 
  683. development information while using Apple's MPW development system. The access can be 
  684. via menus and command keys or from command line entries.  The software development 
  685. information includes language-specific Inside Macintosh documentation, Tech Notes, 
  686. MPW command descriptions and Resource information.  In addition a facility for automatic 
  687. insertion of Toolbox call templates is provided.
  688.  
  689. "411" can also be customized and extended and new information can be added.  The help 
  690. files of "411" may be either local or on a shared file server.
  691.  
  692. Setting up "411"
  693.  
  694. "411" consists of a installation instructions file (Read Me First), a special UserStartup 
  695. script (UserStartup•Help), an installation script (Install411), and a set of help files 
  696. along with their .index and .wIndex files. It makes use of a new MPW tool, Get, which was  
  697. written to support "411" but can be used independently.  The "411" folder holds the help files,
  698. their index and cross reference index files and a "Tools" folder.  
  699.  
  700. An important decision to make in setting up "411" is whether to place the "411" Help files 
  701. on a server or on your local hard disk.  Since these files are large (over 16 Meg total) some 
  702. thought should go into deciding which files to use and whether to transfer them to your 
  703. hard disk or, if you are connected to a network, to a file server.  The most obvious candidate
  704. for removal is either CIncludesHelp or PInterfacesHelp.  If you are not developing in 
  705. both C and Pascal, one of them will probably not be needed. Less obvious, but more significant
  706. canidates for removal are the .wIndex files.  These files are not required but significantly 
  707. speeds up the cross reference search done when selecting the 'Search' menu item.  Placing the
  708. help files on a local hard disk will provide better access speed but will use significant disk
  709. space.  If you have access to a file server and several persons want to access "411" Help, it
  710. may be best to move the "411" folder to the file server.
  711.  
  712. Set up "411" by writing the following two commands to your MPW WorkSheet and 
  713. executing them:
  714.  
  715. <rls>:Install411 <info>
  716. Execute "{ShellDirectory}"UserStartup•Help
  717.  
  718. where <rls> denotes the path to the "411" files on the release medium and <info> denotes 
  719. the volume on which the user wishes the "411" Help files to reside.  If <info> is omitted, 
  720. the installation will be to the volume that begins the path <rls>.  (In this latter case, the 
  721. data files are not duplicated because they are already residing in the desired place.)
  722. For example, if "411" were to be released in a folder named 411Stuff on a CD named MPW 
  723. 3.2 Release, and the user wanted "411" to be installed on a volume named HelpMe, then 
  724. the commands to be executed would read:
  725.  
  726. 'MPW 3.2 Release:411Stuff:Install411' HelpMe:
  727. Execute "{ShellDirectory}"UserStartup•Help
  728.  
  729. The effect of the first of the above commands is to create the folder HelpMe:411: and to 
  730. copy to it all of the "411" files.  It then, additionally, copies the new Get tool to the 
  731. user’s MPW Tools folder, copies UserStartup•Help to the MPW folder, and creates a folder 
  732. called Help Folder in the MPW folder.  This latter folder contains at this time a file called 
  733. Help_Folder whose contents is the single line: HelpMe:411:, i.e. the name of the folder 
  734. containing the "411" information.  The effect of the second of the above commands is to 
  735. add the "411" menu to the menu bar, and to add one more file to the Help Folder,  a file 
  736. called Help_Files which  contains the names of all of the "411" data files in the order in 
  737. which they will be interrogated, e.g.:
  738.  
  739. HelpMe:411:CIncludesHelp
  740. HelpMe:411:InsideMacintoshHelp
  741. HelpMe:411:MPWHelp
  742. HelpMe:411:PInterfacesHelp
  743. HelpMe:411:ResourcesHelp
  744. HelpMe:411:TechNotesHelp
  745.  
  746. NOTE:  Because the cross reference (.wIndex) files are so large they are not installed
  747. automatically.  If you want to use these files just drag their icon to the desired folder.
  748.  
  749. Using the "411" Help menu
  750.  
  751. "411" works only from within the MPW development environment.  When "411" is properly 
  752. set up, there should be a 411 menu on the MPW menu bar.  If there has been no 
  753. change to the UserStartup•Help script, the Help menu looks like this:
  754.  
  755.  
  756.  411 Menu
  757.     
  758.         Directory  Build  411                   
  759.        ________________________________________________
  760.           HD:MPW:Worksheet       |  Contents          |
  761.        __________________________|  Look up    CMD-E  |
  762.                                  |  Template   CMD-1  |
  763.                                  |  Show Keys         |
  764.                                  |  Search            |
  765.                                  |____________________|
  766.                                  |  Set First File ...|
  767.                                  |  Set 411 Files ...|
  768.                                  |  Edit 411 Files ...|
  769.                                  |____________________|
  770.                                  |  About 411 ...     |
  771.                                  |____________________|
  772.  
  773. The menu items Look up and Template search all of the files listed in Help_Files; 
  774. the items Contents, Show Keys, and Search look only at the first file in the 
  775. Help_Files list.  This first file is known as the currently selected file.  It can be changed 
  776. by using the Set First File menu item.
  777.  
  778.  
  779. Contents
  780.  
  781. This menu item lets you see a list of the Help file’s table of contents.  For example, if the 
  782. CIncludesHelp file is the currently selected Help file, then selecting the "Contents" menu 
  783. item, causes a list of the ToolBox managers to appear in the Help window.
  784. ————————————————————————————————————————————————————————————————————————
  785. HelpMe:411:CIncludesHelp           Look up… "Help" 
  786. ————————————————————————————————————————————————————————————————————————
  787. Appletalk.h       FixMath.h         Palettes.h     Serial.h
  788. Controls.h        Fonts.h           Perf.h         ShutDown.h
  789. CursorCtl.h       Globals           Picker.h       Slots.h
  790. Desk.h            Graf3D.h          Printing.h     Sound.h
  791. Deskbus.h         HyperXCmd.h       Quickdraw.h    Start.h
  792. ...
  793.  
  794. Note that you can obtain the same information by selecting the key word "Help" (or the 
  795. name of the help file, e.g. CIncludesHelp) and then selecting the Look up menu item.  
  796.  
  797.  
  798. Look up  (Command-E)
  799.  
  800. This menu item lets you look up information stored in the help files; the search starts with 
  801. the currently selected file (See Set First File...).   For example, if you choose (see 2 
  802. below) the word FindWindow and then select the Look up menu item (or type Command-E) the 
  803. following information will appear in the Help window:
  804.  
  805. ------------------------------------------------------------------------
  806. HelpMe:411:CIncludesHelp     Look up… "findwindow" 
  807. ------------------------------------------------------------------------
  808. short findwindow(Point *thePoint,WindowPtr *theWindow);
  809. Type: Function
  810. File {CIncludes}Windows.h
  811. Trap Number A92C
  812. InsideMacintosh Reference: FindWindow function I-287, P-35, 114, 170 
  813. FindWindow procedure  V-208
  814. [Macintosh Plus, Macintosh SE, Macintosh II]
  815.  
  816. When a mouse-down event occurs, the application should call FindWindow 
  817. with thePt equal to the point where the mouse button was pressed (in 
  818. global coordinates, as
  819. ...
  820. Thus, to get help for a given key word:
  821.  
  822. 1) Choose the Help file you want information from by using the Set First File... menu 
  823. item to make the desired file the first file (currently selected file) in the help file list.  
  824. (Skip this step if the help file is already selected, or if the order of search does not 
  825. matter.)
  826.  
  827. 2) Click on a word in the active window.  You may want to type in the word you want to 
  828. look up instead.  If the item is just one word, it will be automatically selected if the 
  829. insertion point is adjacent to or within the word.  Only if a multiple word item is to be 
  830. looked up is it necessary to do a manual selection of the entire item.  (Note:  the means 
  831. you don’t have to double-click.  Also you don’t have to type the entire word, just 
  832. enough letters to allow 411 to distinguish between the word you want and any other in 
  833. the current Help file.)  
  834.  
  835. 3) Select the menu item Look up or type Command-E.  This triggers a search through the help 
  836. files, in the order in which they are listed,  looking for the selected key word.  If the 
  837. search is successful then a window named Help (a file in the MPW directory) is opened 
  838. and the information associated with the key word is displayed, along with an indication 
  839. of the file in which the key word was found.
  840.  
  841. Remember, the Look up menu item simply looks for the current selection in the active 
  842. window.
  843.  
  844. Since numbers are keywords only in TechNotesHelp, selecting a number will retrieve the 
  845. Macintosh Technical note of that number.
  846.  
  847. The header, which is placed above the "Contents" information, shows the help file that was 
  848. used.  To the right of the file name is a message indicating the key word on which the 
  849. search was made.  A mark is set to this (selected) key word in the file Help to aid the user 
  850. in subsequent scanning of Help for previously gathered information.  
  851.  
  852. A slight modification of UserStartup•Help causes the header to list all the "411" files in 
  853. the order in which they are searched, with  the words on the right (Look up…) printed on 
  854. the line bearing the name of the file in which the item was actually found.  (See 
  855. Customizing "411" below.)
  856.  
  857.  
  858. Template  (Command-1)
  859.  
  860. This menu item lets you replace a toolbox function call such as FindWindow with the 
  861. template for that function.  For example if you were to select "FindWindow" and choose 
  862. the 'Template' menu item (or type Command-1), then your "FindWindow" selection in the Active 
  863. window would be replaced by:
  864.  
  865. short myVariable = findwindow((Point *)thePoint,(WindowPtr *)theWindow);
  866.  
  867. Both C and Pascal templates are available.  Use Set First File... on the 411 menu to 
  868. choose a language by selecting either CIncludesHelp or PInterfacesHelp.
  869.  
  870.  
  871. Show keys…
  872.  
  873. This menu item lets you list all of the keys in the currently selected help file which begin 
  874. with the word you have selected in the Request dialog.  For example, selecting this menu 
  875. and then typing the two letters "fs" when CIncludesHelp is your current (first listed) help 
  876. file, produces a list of all of the HFS calls that begin with "FS", i.e. FSClose, ...
  877.  
  878.  
  879. Search…
  880.  
  881. This menu item lets you search the currently selected help file for all occurrences of the 
  882. word you have selected.  The result is a list of names (keys) whose data records contain the 
  883. word.  On a large Help file, e.g. CIncludesHelp, this can take a minute or more.  Only the 
  884. current  (first listed) help file is searched even if no data record containing the word is 
  885. found.  If your help folder contains a cross reference (.wIndex) file for the Help file the
  886. time to search a file is reduced to several seconds.
  887.  
  888.  
  889. Set First File…
  890.  
  891. This menu item lets you choose a help file to be the currently selected file.  A dialog window 
  892. shows a list of all help files, and you are invited to make a selection.   The selected file 
  893. then becomes the first file in the list that appears in the file Help_Files.  It is then known 
  894. as the currently selected file, and, until you again reorder the list, is the initial target 
  895. of all Look up, Template, and Contents requests, and the only file used by Show Keys and 
  896. Search.  The Help window opens, displaying the contents list of the selected file.  
  897.  
  898. Set 411 Files…
  899.  
  900. This menu item presents a standard file dialog from which to locate a help folder.  If a help 
  901. folder is selected then all the files in the folder that end in the word help are placed in 
  902. the list of files to search (in Help_Files).  Note that this will remove any existing files 
  903. from the list..
  904.  
  905.  
  906. Edit 411 Files
  907.  
  908. This menu item open the Help_Files window, which contains a list of all the help files 
  909. that "411" knows about.  The list may be edited and then saved.  Note that each line 
  910. specifies a path to a single help file.
  911.  
  912.  
  913. About 411…
  914.  
  915. This menu item displays the credits and then does a lookup in the MPWHelp file for the 
  916. key "About411".
  917.  
  918.  
  919. Customizing "411"
  920.  
  921. There are several ways in which "411" can be customized by modifying the 
  922. UserStartup•Help script:
  923.  
  924. •   If you are using a file server and want the script to call the MPW Choose tool to mount 
  925.     the file server when MPW is launched, set the script variables Help_Server and 
  926.     Guest. Set the former to the desired zone:server:volume pathname, and set the 
  927.     latter to 1 if want to log onto the server as an AppleShare "guest.".  Note: This requires 
  928.     the Choose tool from MPW 3.2 or later.
  929.  
  930. •   If you wish to add or change command keys in the menu, simply edit the AddMenu 
  931.     commands in the UserStartup•Help script. For example, the line
  932.  
  933.     AddMenu 411 "Look up/1" 
  934.  
  935.     in the script could be changed to:
  936.  
  937.     AddMenu 411 "Look up/7" 
  938.  
  939.     to change the function key to Command-7.  Alternatively,
  940.  
  941.     AddMenu 411 "Look up" 
  942.     removes the function key associated with the Look up menu item entirely.
  943.  
  944. •   If you wish to change the name of the "411" menu, modify the argument of the AddMenu 
  945.     command.  For example, you can change the menu name "411" to "MyMenu" by 
  946.     changing all occurrences of AddMenu 411... to AddMenu MyMenu... in the 
  947.     UserStartup•Help script.
  948.  
  949. •   If you wish all help files to be listed in the header, change the script so that it sets 
  950.     the value of the variable headerStyle to -h (the default is -h2).
  951.  
  952.  
  953. Using the Get Tool
  954.  
  955. The retrieval of information through the "411" Help menu is based upon calls to the MPW 
  956. Get tool.  The calls that are used by "411" can be seen in the file UserStartup•Help.  If 
  957. you choose, you may instead call the Get tool directly or from your own script.  
  958.  
  959. (See the section on Get in the MPW 3.2 B1 Tools/Scripts Release Notes.)  
  960.  
  961.  
  962. Adding your own help to "411"
  963.  
  964. Help files used by the Get tool are ordinary MPW Shell document files whose names end 
  965. with "Help" and that have an internal organization which is recognized by the Get tool.  
  966. The requirements are that a Help file consists of a set of records, each record in turn 
  967. consisting of one or more fields.  Each record must start with the field tag æKY ("æ" is 
  968. option-')  followed by one or more words separated by carriage returns.  The search of the 
  969. help file is made on the key words.  All other fields are various categories of information to
  970. be retrieved.  Field tags must be the first item on a line, and are separated from the 
  971. following material by one or more spaces.  Field tags are case sensitive.  Each field is 
  972. terminated by the appearance of a new field tag.  The record is terminated by the next æKY tag
  973. (or end of file).
  974.  
  975. Example:
  976.  
  977.  
  978.  æKY Key1
  979.      Key2
  980.      Key3
  981.  æC This is a comment
  982.  
  983. The various tags other than æKY are used to put the information to be retrieved into 
  984. categories.  The most neutral of them is æC, which is used for general textual matter.  These 
  985. tags in some cases modify the behavior of Get.  For example, the tag æDT, which is used 
  986. for templates, precedes data which will be retrieved if and only if Get is called with the -t 
  987. option.  This is used in the implementation of the "template" menu item.  Other tags cause 
  988. some boiler plate to be emitted prior to the text in the data base.  For example, the tag æRI 
  989. is used for fields that contain chapter and page references to Inside Macintosh.  The text 
  990. following the field tag will have inserted before it the cosmetic text:  "InsideMacintosh 
  991. Reference:".  
  992.  
  993. Field Tag Codes:
  994.  
  995.  æKY     Key word or set of key words separated by carriage returns.  This field denotes
  996.          the beginning of  a "411" record and the words in this field are the record's
  997.          names, i.e. the words used as keys for retrieval of the record’s data.
  998.  
  999.  æKL     Key word List .  This is typically used in conjunction with the key "Help" to
  1000.          list, as a table of contents, all of the key words in the file.
  1001.  
  1002.  æFa     File name of Assembler include file.
  1003.  
  1004.  æFc     File name of C header file.
  1005.  
  1006.  æFp     File name of Pascal Interface file.
  1007.  
  1008.  æF      Used for the names of files which are not interfaces.
  1009.  
  1010.  æT      Type of the item:  function/structure/constant/etc. 
  1011.  
  1012.  æD      Formal declaration of the item: function, procedure, or structure. 
  1013.  
  1014.  æDT     A template for calls of procedures and functions.
  1015.  
  1016.  æC      Commentary.  This is general textual information, generally lengthy compared
  1017.         to that associated with the other tags.
  1018.  
  1019.  æR      Reference to…  Used for references other than to Tech Notes and Inside
  1020.         Macintosh.
  1021.  
  1022.  æRI     Reference to Inside Macintosh.  This is usually a chapter and page reference.
  1023.  
  1024.  æRT     Reference to Tech Note.  This is usually a reference by number.
  1025.  
  1026.  æTN     Trap Number.  This is used to annotate function that are in-line trap calls.
  1027.  
  1028.  æMM     Routine may move or purge memory.  This tag cause issuance of the preceding
  1029.         warning.
  1030.  
  1031.  
  1032. When the Get tool is executed, it first retrieves the byte offset of a key word from the index 
  1033. file, positions to the æKY line in the help file, and then reads all of the following lines 
  1034. until another æKY typed line is encountered.  Get then outputs the record, after first 
  1035. removing the field tag codes from each field.  Therefore, if the contents of a help file are
  1036. altered in any way, it is necessary that the index be rebuilt.  This is handled automatically
  1037. by the Get tool, which puts up a dialog stating that the index needs to be rebuilt and
  1038. requesting permission.  In ordinary circumstances, this dialog should be answered 
  1039. affirmatively.
  1040.  
  1041.  
  1042. About the files in your "411" folder
  1043.  
  1044. The "411" folder contains the following files:
  1045. :411:
  1046.        Install411                   # the "411 installation script.
  1047.        CIncludesHelp                # the CIncludesHelp data file. 
  1048.        CIncludesHelp.index          # the CIncludesHelp index file. 
  1049.        CIncludesHelp.windex         # the CIncludesHelp cross reference index file. 
  1050.        InsideMacintoshHelp          # Vols. 1-6 data file.
  1051.        InsideMacintoshHelp.index    # Vols. 1-6 index file.
  1052.        InsideMacintoshHelp.windex   # Vols. 1-6 cross reference index file.
  1053.        MPWHelp                      # the MPWHelp data file.
  1054.        MPWHelp.index                # the MPWHelp index file.
  1055.        MPWHelp.windex               # the MPWHelp cross reference index file.
  1056.        PInterfacesHelp              # the PInterfacesHelp data file.
  1057.        PInterfacesHelp.index        # the PInterfacesHelp index file.
  1058.        PInterfacesHelp.windex       # the PInterfacesHelp cross reference file.
  1059.        ResourcesHelp                # the ResourcesHelp data file.
  1060.        ResourcesHelp.index          # the ResourcesHelp index file.
  1061.        ResourcesHelp.windex         # the ResourcesHelp cross reference index file.
  1062.        TechNotesHelp                # the TechNotesHelp data file.
  1063.        TechNotesHelp.index          # the TechNotesHelp index file.
  1064.        TechNotesHelp.windex         # the TechNotesHelp cross reference index file.
  1065.                           
  1066.  
  1067. :411:Tools:
  1068.        Get                          # the Get MPW tool - used to
  1069.                                     # look up help info.
  1070.        UserStartup•Help             # the "411" UserStartup script.
  1071.  
  1072.  
  1073. Files created by "411"
  1074.  
  1075. The following files are created by the UserStartup•Help script, either at startup time, or 
  1076. as the result of execution of menu items created by the script.  They all reside in the folder 
  1077. "{MPW}Help Folder:"
  1078.  
  1079.  
  1080.  
  1081.          Help                      # your "411" Help window.
  1082.          Help_Folder               # contains the "411" path name 
  1083.                                    # (path name to help data and 
  1084.                                    # index files) 
  1085.          Help_Files                # contains the list of all help  
  1086.                                    # files (full file names including path)
  1087.          Help_Temp                 # temporary file used by the "411" menu
  1088.  
  1089.  
  1090.  
  1091. æKY AddPane
  1092. æC                         AddPane-- split the window into panes
  1093.  
  1094. AddPane[-p paneSpec] [-h ySplit | -v xSplit] [window]
  1095.      -p paneSpec           # choose a pane to split
  1096.      -y ySplit             # horizontal split at ySplit pixels from top
  1097.      -x xSplit             # vertical split at xSplit pixels from left
  1098.  
  1099.       Note: paneSpec is an alternating catenation of strings of the 
  1100.       form cm and rn, where m is a column ordinal and n is a row ordinal.
  1101.  
  1102.  
  1103.  
  1104. æKY AddMenu
  1105. æC                      AddMenu -- add a menu item
  1106.  
  1107. AddMenu [menu [item [command…]]]  > menuList
  1108.  
  1109. Status codes returned:
  1110.   0    No errors.
  1111.   1    Syntax error.
  1112.   2    An item can’t be redefined.
  1113.   3    System error.
  1114.  
  1115.                            Description
  1116.  
  1117.   Associates a list of commands with the menu item itemName in the
  1118.   menu menuName. If the menu menuName already exists, the new item
  1119.   is appended to the bottom of that menu. If the menu menuName doesn’t
  1120.   already exist, a new menu is appended to the menu bar, and the new
  1121.   item is appended to that menu. When the new menu item is selected,
  1122.   its associated command list is executed just as though the command
  1123.   text had been selected and executed in the active window.
  1124.  
  1125.     • Note: The command text that you specify for an AddMenu item
  1126.     is processed twice—once when you execute the AddMenu command
  1127.     itself, and again whenever you subsequently select the new menu
  1128.     item. This means that you must be careful to quote items so that
  1129.     they are processed at the proper time. See the "Examples" section
  1130.     below.
  1131.  
  1132.   You can also use AddMenu to display information for existing user-defined
  1133.   menus by omitting parameters:
  1134.  
  1135.     • If command is not specified, the command list associated with
  1136.     itemName is written to standard output.
  1137.  
  1138.     • If itemName and command are both omitted, a list of all user-defined
  1139.     items for menuName is written to standard output.
  1140.  
  1141.     • If no parameters are specified, a list of all user-defined
  1142.     items is written to standard output.
  1143.  
  1144.   (This output is in the form of AddMenu commands.)
  1145.  
  1146.   You can also use AddMenu to change the command list or markings associated
  1147.   with a particular itemName. If both menuName and itemName already
  1148.   exist, the command list associated with itemName will be changed
  1149.   to command. Also, any marking or styles associated with itemName
  1150.   will be changed. The position of itemName in menuName will not be
  1151.   affected.
  1152.  
  1153.   You can define keyboard equivalents, character styles, and other
  1154.   features for your new menu commands—itemName can contain any of the
  1155.   metacharacters that are used with the AppendMenu( ) procedure documented
  1156.   in the MPW chapter entitled "Menu Manager" of Inside Macintosh:
  1157.  
  1158.   /char        Assign the keyboard equivalent Command-char.
  1159.  
  1160.   !char        Place char to the left of the menu item.
  1161.  
  1162.   ^n           Item has an icon, where n is the icon number. See Inside 
  1163.                Macintosh.
  1164.  
  1165.   (            Item is disabled (dimmed).
  1166.  
  1167.   <style       Item has a special character style; this style can be any
  1168.                of the following capital letters:
  1169.  
  1170.                B Bold
  1171.  
  1172.                I Italic
  1173.  
  1174.                U Underline
  1175.  
  1176.                O Outline
  1177.  
  1178.                S Shadow
  1179.  
  1180.   Multiple styles may be specified by preceding each with "<". Be sure
  1181.   to quote menu items containing these special characters. (See the
  1182.   "Examples" section below.)
  1183.  
  1184.     • Note: Semicolons ( ; ) cannot be used within an itemName.
  1185.  
  1186.   Menu items can’t be appended to the Window, Mark, or Apple menus.
  1187.  
  1188.  
  1189.                             Examples
  1190.  
  1191.   AddMenu
  1192.  
  1193.   Lists all user-defined menu items.
  1194.  
  1195.   AddMenu Extras "TimeStamp//P" 'Echo `Date`'
  1196.  
  1197.   Adds an "Extras" menu with a "TimeStamp" item, which writes the current
  1198.   time and date to the active window. This item has the Command-key
  1199.   equivalent Command-P.
  1200.  
  1201.   AddMenu File 'Format<B' 'Erase 1'
  1202.  
  1203.   Adds a "Format" item to the File menu (as discussed under the Erase
  1204.   command) and makes the item bold.
  1205.  
  1206.   AddMenu Find Top 'Find • "{Active}"'
  1207.  
  1208.   Adds the menu item "Top" to the Find menu, and defines it as the
  1209.   Find command enclosed in single quotation marks. This command places
  1210.   the insertion point at the beginning of the active window.
  1211.  
  1212.   Note: The following attempt to do the same thing will not work:
  1213.  
  1214.   AddMenu Find Top "Find • {Active}"
  1215.  
  1216.   This command won’t work because the {Active} variable will be expanded
  1217.   when the menu is added. (It should be expanded when the menu item
  1218.   is executed.) In the first (correct) example, the single quotes defeat
  1219.   variable expansion when the AddMenu command is executed; they are
  1220.   then stripped before the item is actually added. The double quotation
  1221.   marks remain, in case the pathname of the active window happens to
  1222.   contain any special characters.
  1223.  
  1224.   You may want to add some or all of the following commands to your
  1225.   UserStartup file:
  1226.  
  1227.   AddMenu Find '(-' ''
  1228.  
  1229.   AddMenu Find 'Top/6' 'Find • "{Active}"'
  1230.  
  1231.   AddMenu Find 'Bottom/5' 'Find ∞ "{Active}"'
  1232.  
  1233.   These commands create several new items in the Find menu. The first
  1234.   is a disabled separator that creates a new section at the bottom
  1235.   of the menu. The Top and Bottom items position the insertion point
  1236.   at the top and bottom of the active window. Both menu items have
  1237.   Command-key equivalents.
  1238.  
  1239.   AddMenu Directory 'Work' 'Directory HD:MPW:Work'
  1240.  
  1241.   AddMenu Directory 'Work!•' 'Directory HD:MPW:Work'
  1242.  
  1243.   The first command creates a command to move to the directory HD:MPW:Work.
  1244.   The second command marks the Work item with a bullet without changing
  1245.   the position of the item in the menu.
  1246.  
  1247.                             See also 
  1248.  
  1249.    DeleteMenu command.
  1250.  
  1251.   "Quoting Special Characters," "How Commands Are Interpreted," and
  1252.   "Defining Your Own Menu Commands" in Chapter 5.
  1253.  
  1254.   "Creating a Menu in Your Program" in chapter "Menu Manager" of Inside
  1255.   Macintosh.
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261. æKY Adjust
  1262. æC                        Adjust -- adjust lines
  1263.  
  1264. Adjust [-c count] [-l spaces] selection [window]
  1265.  
  1266.  -c count                # repeat the Adjust count times
  1267.  -l spaces               # shift lines by "spaces" spaces
  1268.  
  1269. Status codes returned:
  1270.   0    At least one instance of the selection was found.
  1271.   1    Syntax error.
  1272.   2    Another error.
  1273.  
  1274.                            Description
  1275.  
  1276.   Finds and selects the given selection and shifts all lines within
  1277.   the selection to the right by one tab, without changing the indentation.
  1278.  
  1279.   If a count is specified, count instances of selection are affected.
  1280.   The -l option lets you move lines by any number of spaces to the
  1281.   left or right.
  1282.  
  1283.   If you specify the window parameter, the command operates on window.
  1284.   It’s an error to specify a window that doesn’t exist. If no window
  1285.   is specified, the command operates on the target window (the second
  1286.   window from the front).
  1287.  
  1288.  
  1289.                             Examples
  1290.  
  1291.   Adjust -l 4 §
  1292.  
  1293.   Shifts the lines containing the target selection to the right by
  1294.   four spaces.
  1295.  
  1296.   Adjust -l -8 /if/Δ:Δ/else/
  1297.  
  1298.   Selects everything after the next "if" and before the following "else",
  1299.   and shifts all lines within the selection to the left by eight spaces.
  1300.  
  1301.                             See also 
  1302.  
  1303.   Align command.
  1304.   "Selections" in Chapter 6.
  1305.  
  1306. æKY Alert
  1307. æC                     Alert -- display an alert box
  1308.  
  1309. Alert [-s] [message…] < file
  1310.  -s                      # silent, don't beep when dialog is displayed
  1311.  
  1312. Status codes returned:
  1313.   0    No errors.
  1314.   1    Syntax error.
  1315.  
  1316.                            Description
  1317.  
  1318.   Displays an alert box containing the prompt message. The alert is
  1319.   displayed until its OK button is clicked. If the message contains
  1320.   any special characters, you’ll need to quote it.
  1321.  
  1322.  
  1323.                             Examples
  1324.  
  1325.   Alert Please insert next disk to be searched.
  1326.  
  1327.   Displays the following alert box and waits for the user to click
  1328.   "OK" before returning.
  1329.  
  1330.                             Also see
  1331.  
  1332.  Confirm and Request commands.
  1333. æKY Alias
  1334. æC               Alias  -- define or write command aliases
  1335.  
  1336. Alias [name [word…]]  > aliasList
  1337.  
  1338. Status codes returned:
  1339.   0    No errors.
  1340.   1    The specified alias could not be found.
  1341.  
  1342.                            Description
  1343.  
  1344.   Name becomes an alias for the list of words. Subsequently, when name
  1345.   is used as a command name, word… will be substituted in its place.
  1346.  
  1347.   If only name is specified, any alias definition associated with name
  1348.   is written to standard output. If name and word are both omitted,
  1349.   a list of all aliases and their values is written to standard output.
  1350.   (This output is in the form of Alias commands.)
  1351.  
  1352.   Aliases are local to the script in which they are defined. An initial
  1353.   list of aliases is inherited from the enclosing script. Inherited
  1354.   aliases may be overridden locally. You can make an alias definition
  1355.   available to all scripts by placing the definition in the UserStartup
  1356.   file.
  1357.  
  1358.   You can remove aliases with the Unalias command.
  1359.  
  1360.  
  1361.                              Examples
  1362.  
  1363.   Alias Dir Directory
  1364.  
  1365.   Creates an alias "Dir" for the Directory command.
  1366.  
  1367.   Alias Top 'Find •'
  1368.  
  1369.   Creates an alias "Top" for the command "Find •" (which places the
  1370.   insertion point at the beginning of a window). The command takes
  1371.   an optional window parameter and by default acts on the target window.
  1372.   The Top command could now be used as follows:
  1373.  
  1374.   Top # find top of target window
  1375.  
  1376.   Top Sample.a # find top of window Sample.a
  1377.  
  1378.   # (equivalent to "Find • Sample.a")
  1379.  
  1380.                             See also
  1381.  
  1382.   Unalias command.
  1383.   "Command Aliases" in Chapter 5.
  1384.  
  1385. æKY Align
  1386. æC                 Align -- align text to left margin
  1387.  
  1388. Align [-c count] selection [window]
  1389.  -c count                # repeat the Align count times
  1390.  
  1391. Status codes returned:
  1392.   0    At least one instance of the selection was found.
  1393.   1    Syntax error.
  1394.   2    Any other error.
  1395.  
  1396.                            Description
  1397.  
  1398.   All lines within each instance of the selection are positioned to
  1399.   the same distance from the left margin as the first line in the selection.
  1400.  
  1401.   If you specify the window parameter, the Align command will act on
  1402.   window. It’s an error to specify a window that doesn’t exist. If
  1403.   no window is specified, the command operates on the target window
  1404.   (the second window from the front).
  1405.  
  1406.  
  1407.                              Examples
  1408.  
  1409.   Align §
  1410.  
  1411.   Same as the Align menu item; that is, it aligns all lines in the
  1412.   default selection with the first line of the selection.
  1413.  
  1414.   Align /Begin/:/End/
  1415.  
  1416.   Selects everything from the next "Begin" through the following "End",
  1417.   and aligns all lines within the selection to the same margin position
  1418.   as the line that contains the "Begin".
  1419.  
  1420.                              See Also
  1421.  
  1422.  Adjust command.
  1423.   "Selections" in Chapter 6.
  1424.  
  1425. æKY Asm
  1426. æC                    Asm -- MC68xxx Macro Assembler
  1427.  
  1428. Asm [option…] [file…]  < file > listing ≥ progress
  1429.  -addrsize size          # set size of address display
  1430.  -blksize blocks         # use blocks * 512 byte I/O buffers
  1431.  -case on                # distinguish between upper and lower case
  1432.  -case obj[ect]          # preserve case in object file
  1433.  -case off               # ignore case (default)
  1434.  -c[heck]                # syntax check only, don't create object file
  1435.  -d[efine] name          # equivalent to: name EQU 1
  1436.  -d[efine] name=value    # equivalent to: name EQU value
  1437.  -d[efine] &name         # equivalent to: &name SET[AC] 1
  1438.  -d[efine] &name=value   # equivalent to: &name SET[AC] value
  1439.  -e[rrlog] file          # write errors and warnings to file
  1440.  -f                      # suppress page ejects in listing
  1441.  -font name[,size]       # set listing font and size
  1442.  -h                      # suppress page headers in listing
  1443.  -i directory,…          # search for includes in directory,…
  1444.  -l                      # write full listing to output
  1445.  -lo file                # listing output file or directory
  1446.  -model far              # allow generation of load-time relocatable 32-bit references 
  1447.  -model near             # prohibit generation of load-time relocatable 32-bit
  1448.                          #    references (the default)
  1449.  -o objname              # generate code in file or directory objname
  1450.  -pagesize l[,w]         # set listing page length and width
  1451.  -print mode             # equivalent to: PRINT mode
  1452.  -p                      # write progress information to diagnostics
  1453.  -s                      # write short listing to output
  1454.  -sym off                # no SADE records
  1455.  -sym on|full            # full SADE records; can modify with [,nolines] 
  1456.                          # [,notypes] [,novars]
  1457.  -t                      # write time and total lines to diagnostics
  1458.  -w                      # suppress warnings
  1459.  -wb                     # suppress warnings on branch instructions
  1460.  
  1461. Status codes returned:
  1462.   0    No errors detected in any of the files assembled.
  1463.   1    Parameter or option errors.
  1464.   2    Errors detected.
  1465.  
  1466.                            Description
  1467.  
  1468.   Assembles the specified assembly-language source files. One or more
  1469.   filenames may be specified. If no filenames are specified, standard
  1470.   input is assembled and the file "a.o" is created. By convention,
  1471.   assembly-language source filenames end in the suffix ".a". Each file
  1472.   is assembled separately—assembling file name.a creates object file
  1473.   name.a.o. The object filename can be changed with the -o option.
  1474.  
  1475.   See the MPW 3.0 Assembler Reference for more information about the
  1476.   assembly language. The first Commando dialog box for this command
  1477.   is reproduced here for convenience.
  1478.  
  1479.  
  1480.                              Examples
  1481.  
  1482.   Asm -w -l Sample.a Memory.a -d Debug
  1483.  
  1484.   Assembles Sample.a and Memory.a, producing object files Sample.a.o
  1485.   and Memory.a.o. Suppresses warnings and defines the name Debug as
  1486.   having the value 1. Two listing files are generated: Sample.a.lst
  1487.   and Memory.a.lst. (Sample.a and Memory.a are located in the AExamples
  1488.   directory.)
  1489.  
  1490.                             See Also
  1491.  
  1492.   MPW3.0 Assembler Reference.
  1493.  
  1494. æKY Backup
  1495. æC                     Backup -- folder file backup
  1496.  
  1497. Backup [option…] -from folder -to folder [file…]  > commands ≥ progress
  1498.  -a                      # copy all files in "from" not in "to"
  1499.  -alt                    # alternate prompts for disk drives
  1500.  -c                      # create "to" folders if they don't exist
  1501.  -check checkopt,…       # produce reports based on checkopt
  1502.                          # checkopt=from     "from" not in "to"
  1503.                          #          to       "to" not in "from"
  1504.                          #          allfroms "from" not in "to" even if none
  1505.                          #          alltos   "to" not in "from" even if none
  1506.                          #          folders  "from" folders not in "to"
  1507.                          #          newer    "to"s newer than "from"s
  1508.  -co filename            # redirect -check reports to filename
  1509.  -compare [only][,'opts']# write compare commands for out-of-date files
  1510.  -d                      # write delete commands for files in "to" not in "from"
  1511.  -do [only][,'command']  # write the command string specified by command…
  1512.  -e                      # eject disk when done
  1513.  -from folder|drive      # specify source folder or drive (1 or 2)
  1514.  -l                      # write directory listing of "from" files
  1515.  -lastcmd 'command'      # write the command string as the last command
  1516.  -level n                # restrict -a and -d to files beyond level n
  1517.  -m                      # multi-disk -- more than one "from" or "to" disk
  1518.  -n                      # show folder nesting by indenting commands 
  1519.  -p                      # write progress information to diagnostics
  1520.  -r                      # recursively process nested folders
  1521.  -revert                 # revert "to" files to their "from" state
  1522.  -since date[,time]|fname# process only files since specified time
  1523.  -sync                   # synchronize both source and destination folders
  1524.  -t type                 # process only files of specified type
  1525.  -to folder|drive        # specify destination folder or drive (1 or 2)
  1526.  -y                      # suppress duplicate -y option
  1527.  
  1528. Status codes returned:
  1529.   0    No errors; Shell duplicate commands have been generated or filenames were     listed.
  1530.   1    Parameter or option errors.
  1531.   3    No errors and no files to duplicate or list.
  1532.   Note:  Backup returns a status code of 3 when no files need copying. 
  1533.        If no files are copied because none of the files in the source folder 
  1534.        exists in the destination folder, Backup also reports a warning to 
  1535.        the diagnostic output file. If there are no name matches, it is 
  1536.        possible that your from/to pathnames were specified incorrectly. 
  1537.        Hence, Backup lets you know of the possible error. Backup does not 
  1538.        report this as an error if you use the  -l, -a, or -since option.
  1539.  
  1540.                            Description
  1541.  
  1542.   Files in a source ("from") folder are copied to a destination ("to")
  1543.   folder based on the modification date. By default, only files that
  1544.   already exist in both the source and destination folders are candidates
  1545.   for copying. (The -a option can override this default.) Backup does
  1546.   not actually make the copies. Instead, it generates a script of MPW
  1547.   Shell duplicate commands.
  1548.  
  1549.   Backup’s default operation is based on the premise that you already
  1550.   have an existing folder on two sets of disks (generally a hard disk
  1551.   and a set of 3.5-inch disks—drive numbers may be specified as folder
  1552.   "names") and that you want to make sure that the files on one of
  1553.   the disks are the same as the files on the other disk. Thus, it is
  1554.   the files on the destination ("to") disk that determine which files
  1555.   can be copied from the source ("from") disk.
  1556.  
  1557.   A Shell duplicate command is generated to the standard output file
  1558.   if
  1559.  
  1560.     • a file on a source disk also exists on the destination disk,
  1561.     and
  1562.  
  1563.     • the modification date of the source is newer than that of the
  1564.     destination.
  1565.  
  1566.   In addition to the basic function of generating Shell duplicate commands,
  1567.   Backup also provides these services:
  1568.  
  1569.     • Folders can be recursively processed, allowing processing of
  1570.     all folders and subfolders contained within folders (-r).
  1571.  
  1572.     • Compare commands can be generated for out-of-date files of
  1573.     type TEXT to discover why the files are different (-compare).
  1574.  
  1575.     • Filenames that exist on one disk and not on the other can be
  1576.     displayed
  1577.  
  1578.   (-check from,to).
  1579.  
  1580.     • File folder names that don’t exist on the destination can be
  1581.     displayed
  1582.  
  1583.   (-check folders).
  1584.  
  1585.     • Filenames in the destination that are newer than the source
  1586.     can be displayed
  1587.  
  1588.   (-check newer).
  1589.  
  1590.  
  1591.                              Examples
  1592.  
  1593.   backup  -from :HDfolder:  -e
  1594.  
  1595.   Check that all files on the disk in drive 1 (-to is omitted, so "-to
  1596.   1" is implied) are up to date with respect to the files in :HDfolder:.
  1597.   If they are, the disk in drive 1 is ejected. If not, the appropriate
  1598.   Duplicate commands are generated to update the out-of-date files
  1599.   on the disk in drive 1. An Eject 1 command is generated to eject
  1600.   the disk after the Duplicate commands are processed.
  1601.  
  1602.   backup  -r  -from FServer:MPW:  -to HD:MPW:  -check folders
  1603.  
  1604.   Recursively process (-r) all the files in all the folders on FServer:MPW:
  1605.   to make sure that the files on HD:MPW: are up-to-date. Appropriate
  1606.   Duplicate commands are generated to copy the out-of-date files from
  1607.   the folders in FServer:MPW: to the folders in HD:MPW:. It is assumed
  1608.   that the folder names in HD:MPW: are the same as the folder names
  1609.   in FServer:MPW:. Any folders in FServer:MPW: that don’t exist in
  1610.   HD:MPW are skipped. Because the -check option is specified, a list
  1611.   of all the skipped folders is written to the diagnostic file.
  1612.  
  1613.   Limitations Multi-disk operation (-m) is not supported with recursion
  1614.   (-r).
  1615.  
  1616.   The -e option is ignored when -m is specified.
  1617.  
  1618.   Only drive numbers 1 and 2 are supported, and they are assumed to
  1619.   be ejectable 3.5-inch disk drives.
  1620.  
  1621. æKY Beep
  1622. æC                       Beep -- generate tones
  1623.  
  1624. Beep [note [,duration [,level]]]…
  1625.  #   duration is given in sixtieths of a second (default is 15)
  1626.  #   sound level is given as a number from 0 to 255 (default is 128)
  1627.  
  1628. Status code returned:
  1629.    0    no errors.
  1630.  
  1631.  
  1632.                            Description
  1633.  
  1634.   For each parameter, Beep produces the given note for the specified
  1635.   duration and sound level on the Macintosh speaker. If no parameters
  1636.   are given, a simple beep is produced.
  1637.  
  1638.   Note is one of the following:
  1639.  
  1640.     • A number indicating the count field for the square wave generator,
  1641.     as described in chapter "Summary of the Sound Driver" of Inside
  1642.     Macintosh.
  1643.  
  1644.     • A string in the following format:
  1645.  
  1646.   [ n ] letter [ # | b ]
  1647.  
  1648.   n is an optional number between –3 and 3 indicating the octaves below
  1649.   or above middle C, followed by a letter indicating the note (A–G)
  1650.   and an optional sharp (#) or flat (b) sign. Note that any sharps
  1651.   (#) must be enclosed in quotation marks—otherwise they will be interpreted
  1652.   as comment delimiters.
  1653.  
  1654.   The optional duration is given in sixtieths of a second. The default
  1655.   duration is 15 (one-quarter second).
  1656.  
  1657.   The optional sound level is given as a number from 0 to 255. The
  1658.   default level is 128.
  1659.  
  1660.  
  1661.                              Examples
  1662.  
  1663.   Beep
  1664.  
  1665.   Produce a simple beep on the speaker.
  1666.  
  1667.   Beep 2C,20 '2C#,40' 2D,60
  1668.  
  1669.   Play the three notes specified: C , C sharp, and D—all two octaves
  1670.   above middle C—for one-third, two-thirds, and one full second, respectively.
  1671.   Notice that the second parameter must be quoted; otherwise the sharp
  1672.   character (#) would indicate a comment.
  1673.  
  1674. æKY Begin
  1675. æC                      Begin  -- group commands
  1676.  
  1677. Begin
  1678.  command…
  1679. End
  1680.  
  1681. The status code of the last command executed is returned. 
  1682. (If no commands appear between Begin and End, 0 is returned.)
  1683.  
  1684.                            Description
  1685.  
  1686.   Groups commands for pipe specifications, conditional execution, and
  1687.   input/output specifications. Carriage returns must appear at the
  1688.   end of each line as shown above, or be replaced with semicolons (
  1689.   ; ). If the pipe symbol (|), conditional execution operators (&&
  1690.   and ||), or input/output specifications (<, >, >>, ≥, ≥≥, ∑, ∑∑)
  1691.   are used, the operator must appear after the End command and applies
  1692.   to all of the enclosed commands.
  1693.  
  1694.     • Note: Begin and End behave like left and right parentheses.
  1695.     Once the Begin command has been executed, the Shell will not
  1696.     execute any of the subsequent commands until it encounters the
  1697.     End command, so that input/output specifications can be processed.
  1698.  
  1699.  
  1700.                              Examples
  1701.  
  1702.   The following commands save the current variables, exports, aliases,
  1703.   and menus in the file SavedState.
  1704.  
  1705.   Begin
  1706.     Set
  1707.     Export
  1708.     Alias
  1709.     AddMenu
  1710.   End > SavedState
  1711.  
  1712.   Notice that the output specification following "End" applies to all
  1713.   of the commands within the Begin…End control command. This command
  1714.   is identical to the following:
  1715.  
  1716.   (Set; Export; Alias; AddMenu) > SavedState
  1717.  
  1718.   The commands Set, Export, Alias, and AddMenu write their output in
  1719.   the form of commands; these commands can be executed to redefine
  1720.   variables, exports, aliases, and menus, respectively. Therefore,
  1721.   after executing the above commands, the command
  1722.  
  1723.   Execute SavedState
  1724.  
  1725.   will restore all of these definitions. You must "execute" the script
  1726.   so that the variables and aliases are applied to the current scope.
  1727.  
  1728.     • Note: This technique is used in the Suspend script to save
  1729.     state information. (You might want to take a look at Suspend,
  1730.     which also saves the list of open windows and the current directory.)
  1731.     The Resume file runs the file that Suspend creates, restoring
  1732.     the various definitions, reopening the windows, and resetting
  1733.     the current directory.
  1734.  
  1735. æKY Break
  1736. æC                   Break -- break from For or Loop
  1737.  
  1738. Break [If expression]
  1739.  
  1740. Status codes returned:
  1741.   0    No errors detected.
  1742.   –3   Break is found outside a For…End or Loop…End, or the parameters
  1743.        to Break are incorrect.
  1744.   –5   Invalid expression.
  1745.  
  1746.                            Description
  1747.  
  1748.   If expression is nonzero, Break terminates execution of the immediately
  1749.   enclosing For or Loop command. (Null strings are considered zero.)
  1750.   If the "If expression" is omitted, the break is unconditional. (For
  1751.   a definition of expression, see the Evaluate command.)
  1752.  
  1753.  
  1754.                              Examples
  1755.  
  1756.   Set Exit 0
  1757.   For file in Startup UserStartup Suspend Resume Quit
  1758.     EnTab "{file}" > temp
  1759.     Break If {Status} != 0
  1760.     Rename -y temp "{file}"
  1761.     Print -h "{file}"
  1762.     Echo "{file}"
  1763.   End
  1764.  
  1765.   This For loop entabs and prints each of the special MPW scripts;
  1766.   the Break command terminates the loop if a nonzero status value is
  1767.   returned. (See the For command for further explanation of this example.)
  1768.  
  1769.   Set loopcount |
  1770.     Loop
  1771.     Break if {loopcount} > 10
  1772.     Echo "Loop Number {loopcount}"
  1773.     Evaluate loopcount +=1
  1774.   End
  1775.  
  1776.   This example loops until the variable {loopcount} is greater than
  1777.   10. Use of the Evaluate command is also demonstrated.
  1778.  
  1779.  
  1780.                              See also 
  1781.  
  1782.   For, Loop, and If commands.
  1783.  
  1784.   Evaluate command (for a description of expressions).
  1785.  
  1786.   "Structured Commands" in Chapter 5.
  1787.  
  1788. æKY Browser
  1789. æC                Browser -- invoke Marker Browser
  1790.  
  1791.                   # The MPW Browser command is used to navigate source files or other text.  It 
  1792.                   # presents a window containing a list of the files in the current directory
  1793.                   # and, for the selected file, a list of markers.  Double-clicking on the marker
  1794.                   # opens the file with the selection point at the marker.  Entering a marker name
  1795.                   # in a text box searches all files in the directory for that marker, and if found 
  1796.                   # opens the file with the selection point at the marker.
  1797.  
  1798. æKY BuildCommands
  1799. æC                BuildCommands -- show build commands
  1800.  
  1801. BuildCommands program [option…] > commands
  1802.  option…                 # Make command options
  1803.  
  1804. Status code 0 is returned if the build commands are generated 
  1805. without error.  If an error occurs, the status code returned by Make is returned.
  1806.  
  1807.                            Description
  1808.  
  1809.   BuildCommands writes to standard output the commands needed to build
  1810.   the specified program.
  1811.  
  1812.   Make is used to generate the build commands. If file program.make
  1813.   exists, it is used as the makefile. If not, file MakeFile is used.
  1814.  
  1815.   The specified options control the generation of the build commands.
  1816.   The options are passed directly to Make. BuildCommands is used to
  1817.   implement the Show Build Commands and Show Full Build Commands menu
  1818.   items in the Build Menu.
  1819.  
  1820.  
  1821.                              Examples
  1822.  
  1823.   Open {Worksheet}
  1824.  
  1825.   BuildCommands Count >> {Worksheet} ≥≥ Dev:StdOut
  1826.  
  1827.   Generates the build commands for Count. The Worksheet window is brought
  1828.   to the front. The build commands, or any errors generated by Make
  1829.   are written at the end of the Worksheet. The Show BuildCommands menu
  1830.   item is implemented using similar commands.
  1831.  
  1832.  
  1833.                              See also 
  1834.  
  1835.   "Building a Program:  An Introduction" in Chapter 2
  1836.  
  1837.       
  1838. æKY BuildMenu
  1839. æC                  BuildMenu -- create the Build menu
  1840.  
  1841. Status codes returned:
  1842.  0    is always returned.
  1843.  
  1844.                            Description
  1845.  
  1846.   Creates the Build menu shown below. Each of the items in the menu
  1847.   is described in Chapter 3 of the MPW Manual.
  1848.  
  1849.  
  1850.                              Examples
  1851.  
  1852.   BuildMenu
  1853.  
  1854.   Creates the Build menu. This command should appear in the UserStartup
  1855.   file to create the Build menu.
  1856.  
  1857.  
  1858.                              See also 
  1859.  
  1860.   "Building a Program: An Introduction" in Chapter 2.
  1861.  
  1862. æKY BuildProgram
  1863. æC             BuildProgram -- build the specified program
  1864.  
  1865. Status code 0 is returned if the build is completed without error. 
  1866. If an error occurs during the generation of the build commands, the status 
  1867. value returned by Make is returned. If an error occurs during the build, the 
  1868. Status value returned by the build step that detected the error (such as Asm 
  1869. or Link) is returned.
  1870.  
  1871. BuildProgram program [option…] > log
  1872.  option…                 # Make command options
  1873.  
  1874.                            Description
  1875.  
  1876.   Builds the specified program. A simple transcript of the build, including
  1877.   timing information and commands used to do the build, is written
  1878.   to standard output.
  1879.  
  1880.   Make is used to determine the commands needed to do the build. If
  1881.   file
  1882.  
  1883.   program.make exists, it is used as the makefile. If not, the file
  1884.   MakeFile is used.
  1885.  
  1886.   The options specified are passed directly to Make; they control the
  1887.   generation of the build commands. BuildProgram is used to implement
  1888.   the Build and Full Build menu items in the Build menu.
  1889.  
  1890.  
  1891.                              Examples
  1892.  
  1893.   Open {Worksheet}
  1894.  
  1895.   BuildProgram -e Count >> {Worksheet} ≥≥ Dev:StdOut
  1896.  
  1897.   Completely rebuilds Count. The Worksheet window is brought to the
  1898.   front. The transcript of the build and any errors are written at
  1899.   the end of the Worksheet. The Full Build menu command is implemented
  1900.   using similiar commands.
  1901.  
  1902.  
  1903.                              See also 
  1904.  
  1905.   "Building a Program:  An Introduction" in Chapter 2
  1906.  
  1907. æKY C
  1908. æC                            C -- C compiler
  1909.  
  1910. C [option…] [file]   < file > preprocessor ≥ progress
  1911.     -b                      # put string constants into code and generate PC-relative references
  1912.                             #   for function addresses
  1913.     -b2                     # implies '-b' above, and allows string constants to be overlaid
  1914.     -b3                     # overlaid string constants in code (but A5-relative references
  1915.                             # for function addresses)
  1916.     -bigseg                 # generate single large (>32K) code segment, 68020 only   
  1917.     -c                      # syntax check only, don't create object file
  1918.     -d name                 # equivalent to: #define name 1
  1919.     -d name=string          # equivalent to: #define name string
  1920.     -e                      # write preprocessor results to output
  1921.     -e2                     # implies '-e' above, and strips comments
  1922.     -elems881               # generate MC68881 code for transcendentals
  1923.     -i directory            # search for includes in directory
  1924.     -k directory            # create load/dump files in directory
  1925.     -m                      # generate 32-bit references for data (less efficient code)
  1926.     -mbg ch8                # v2.0 compatible macsbug symbols
  1927.     -mbg off                # no macsbug symbols in the code 
  1928.     -mbg on|full            # full macsbug symbols
  1929.     -mbg <n>                # macsbug symbols to length <n> (<n> can be 0..255)
  1930.     -mc68020                # generate MC68020 code 
  1931.     -mc68881                # generate MC68881 code for arithmetic operations
  1932.     -model farCode|         # generate load-time relocatable 32-bit references for
  1933.         farData|far         #   code, data, or both
  1934.     -model nearCode|        # generate 16-bit references for code, data, or both 
  1935.         nearData|near       #   (the default)
  1936.     -n                      # Turn pointer assignment incompatibility errors into warnings
  1937.     -notonce                # do not automatically suppress multiple inclusion of files
  1938.     -o objname              # generate code in file or directory objname
  1939.     -opt off                # don't apply code optimizations
  1940.     -opt on | full          # choose level of code optimization ( on is default );
  1941.                             #    can modify with [,nopeep] [,nocse]
  1942.                             #    ( no peephole, no common subexpression)
  1943.     -p                      # write progress information to diagnostic
  1944.     -r                      # warn on calling a function that has no definition
  1945.     -s segment              # generate code in segment
  1946.     -sym off                # don't generate SADE records
  1947.     -sym on | full          # generate SADE records; can modify with [,nolines] [,notypes] [,novars]
  1948.     -t                      # write compilation time to diagnostic
  1949.     -trace always|never     # enable/disable calls to profiler or MacApp debugger
  1950.                             #   (overrides #pragma trace on|off)
  1951.     -trace on|off           # enable/disable calls to profiler or MacApp debugger
  1952.                             #   (subject to #pragma trace on|off)
  1953.     -u name                 # equivalent to: #undef name
  1954.     -warnings on|off|full   # set warning level; "on" is the default
  1955.     -y directory            # create temporary files in directory
  1956.  
  1957. Status codes returned:
  1958.   0    Successful completion.
  1959.   1    Errors occurred.
  1960.  
  1961.                            Description
  1962.  
  1963.   Compiles the specified C source file. Compiling file Name.c creates
  1964.   object file Name.c.o. (By convention, C source filenames end in a
  1965.   ".c" suffix.) If no filenames are specified, standard input is compiled
  1966.   and the object file "c.o" is created.
  1967.  
  1968.   (Note that SADE object file information cannot be generated for standard
  1969.   input source files.)
  1970.  
  1971.   See the MPW 3.0 C Reference Manual for details of the C language
  1972.   definition.
  1973.  
  1974.                              Examples
  1975.  
  1976.   C -p Sample.c
  1977.  
  1978.   Compiles Sample.c, producing the object file Sample.c.o. Writes progress
  1979.   information to diagnostic output. (Sample.c is found in Examples:CExamples.)
  1980.  
  1981.  
  1982.                              See also 
  1983.  
  1984.   MPW3.0C Reference.
  1985.  
  1986.  
  1987. æKY Canon
  1988. æC                   Canon -- canonical spelling tool
  1989.  
  1990. Canon [option…] dictionary [file…]   < file > new
  1991.  -s                      # case sensitive replacement
  1992.  -a                      # assembler identifiers (include $, %, @)
  1993.  -c n                    # consider only the first n characters
  1994.  
  1995. Status codes returned:
  1996.   0    All files processed successfully.
  1997.   1    Error in command line.
  1998.   2    Other errors.
  1999.  
  2000.                            Description
  2001.  
  2002.   Canon copies the specified files to standard output, replacing identifiers
  2003.   with the canonical spellings given in dictionaryFile. If no files
  2004.   are specified, standard input is processed.
  2005.  
  2006.   DictionaryFile is a text file that specifies the identifiers to be
  2007.   replaced and their new (or canonical) spellings. Identifiers are
  2008.   defined as a letter followed by any number of letters or digits.
  2009.   (The underscore character ( _ ) is also considered a letter.) Each
  2010.   line in the dictionary contains either a pair of identifiers or a
  2011.   single identifier:
  2012.  
  2013.     • If two identifiers appear, the first is the identifier to replace,
  2014.     and the second is its canonical spelling. For example, the dictionary
  2015.     entry
  2016.  
  2017.     NIL NULL # change NIL to NULL
  2018.  
  2019.     changes each occurrence of "NIL" to "NULL".
  2020.  
  2021.     • A single identifier specifies both the identifier to match
  2022.     and its canonical spelling. This feature is useful because the
  2023.     matching may not be case sensitive or restricted to a fixed number
  2024.     of characters. (See the "Options" section on the next page.)
  2025.     For example, the dictionary entry
  2026.  
  2027.     true
  2028.  
  2029.     changes all occurrences of "TRUE", "True", "tRUE", and so on to "true".
  2030.  
  2031.   You can specify a left context for the first identifier on each line
  2032.   of the dictionary by preceding it with a sequence of nonidentifier
  2033.   characters. Replacement will then occur only if the left context
  2034.   in the input file exactly matches the left context in the dictionary.
  2035.   For example, if C structure component upperLeft should be replaced
  2036.   with topLeft, the dictionary might include the following:
  2037.  
  2038.   .upperLeft topLeft
  2039.   ->upperLeft topLeft
  2040.  
  2041.   You can include comments in the dictionary file by using the # symbol:
  2042.   everything from the # to the end of the line is ignored.
  2043.  
  2044.     • Note: The file Canon.Dict is a sample dictionary file that’s
  2045.     included with MPW. (See the "Examples" section below.)
  2046.  
  2047.  
  2048.                              Examples
  2049.  
  2050.   The file Canon.Dict, in the Tools folder, contains a list of all
  2051.   of the identifiers used in the Standard C library and the Inside
  2052.   Macintosh C interfaces. This list was made from the Library Index
  2053.   in the MPW 2.0 C Reference. The entries in Canon.Dict look like the
  2054.   following:
  2055.  
  2056.   abbrevDate
  2057.   ABCallType
  2058.   abortErr
  2059.   ABProtoType
  2060.   abs
  2061.   acos
  2062.   activateEvt
  2063.   …
  2064.  
  2065.   The following command copies the file Source.c to the file Temp;
  2066.   identifiers whose first eight characters match a dictionary entry
  2067.   are replaced with that entry.
  2068.  
  2069.   Canon -c 8 {MPW}Tools:Canon.Dict Source.c > Temp
  2070.  
  2071.   The -c 8 option is useful when porting source code from other systems
  2072.   where only eight characters are significant.
  2073.  
  2074.     • Note: The list of Pascal identifiers used in the Inside Macintosh
  2075.     interface is almost identical to the list used in C. The dictionary
  2076.     Canon.Dict can also be used to port Pascal programs from other
  2077.     systems, as long as you use the canonical capitalizations for
  2078.     the various Standard C library identifiers.
  2079.  
  2080.   Limitations The maximum line length in the dictionary file is 256
  2081.   characters. Longer lines are considered an error. Identifiers and
  2082.   words in comment sections are replaced.
  2083.  
  2084. æKY Catenate
  2085. æC                    Catenate -- concatenate files
  2086.  
  2087. Catenate [file…]  < file > catenation
  2088.  
  2089. Status codes returned:
  2090.   0    All files were processed successfully.
  2091.   1    One or more files were not found.
  2092.   2    An error occurred in reading or writing.
  2093.  
  2094.                            Description
  2095.  
  2096.   Catenate reads the data fork of each file in sequence and writes
  2097.   it to standard output. If no input file is given, Catenate reads
  2098.   from standard input. None of the input files may be the same as the
  2099.   output file.
  2100.  
  2101.  
  2102.                              Examples
  2103.  
  2104.   Catenate Makefile.a
  2105.  
  2106.   Writes Makefile.a to the active window immediately following the
  2107.   command.
  2108.  
  2109.   Catenate File1 File2 > CombinedFile
  2110.  
  2111.   Concatenates the first two files and places the result in the third.
  2112.   If CombinedFile doesn’t exist, it will be created; if it exists,
  2113.   it will be overwritten.
  2114.  
  2115.   Set selection "`Catenate §`"
  2116.  
  2117.   Captures the selection from the target window in the Shell variable
  2118.   {selection}.
  2119.  
  2120.   Catenate >> {Worksheet}
  2121.  
  2122.   Appends all subsequently entered text to the Worksheet window (until
  2123.   you indicate end-of-file by pressing Command-Enter).
  2124.  
  2125.   Warning Beware of commands such as
  2126.  
  2127.   Catenate File1 File2 > File1
  2128.  
  2129.   The above command will cause the original data in File1 to be lost.
  2130.   To append one file to another, use the form
  2131.  
  2132.   Catenate File2 >> File1
  2133.  
  2134.  
  2135.                              See also 
  2136.  
  2137.   Duplicate command.
  2138.  
  2139.   "Redirecting Input and Output" in Chapter 5.
  2140.  
  2141. æKY CFront
  2142. æC                     CFront -- C++ to C translator
  2143.  
  2144. CFront [option…] [file…] < file > intermediate output ≥ progress
  2145.     -a                      # force ANSI-style intermediate C code (default)
  2146.     -a0                     # force K&R-style (pre-ANSI) intermediate C code
  2147.     -a1                     # force ANSI-style intermediate C code (default)
  2148.     -c                      # intermediate code to standard output; no object file
  2149.     -d name                 # equivalent to: #define name 1
  2150.     -d name=string          # equivalent to: #define name string
  2151.     -e                      # write preprocessor results to output
  2152.     -e2                     # implies '-e' above, and strips comments
  2153.     -elems881               # generate MC68881 code for transcendentals
  2154.     -f filename             # act as if input comes from named file when it actually is from stdin 
  2155.     -f1                     # send text version of C code to C compiler (no token stream)
  2156.     -i directory            # search for includes in directory
  2157.     -mc68020                # generate MC68020 code 
  2158.     -mc68881                # generate MC68881 code for arithmetic operations
  2159.     -mtbl0                  # suppress output of method tables for Object Pascal Classes
  2160.     -mtbl1                  # force output of method tables for Object Pascal Classes
  2161.     -n                      # Turn pointer assignment incompatibilty errors into warnings
  2162.     -p                      # write progress information to diagnostic
  2163.     -s segment              # generate code in segment
  2164.     -u name                 # equivalent to: #undef name
  2165.     -vtbl0                  # suppress output of virtual tables for ordinary class
  2166.     -vtbl1                  # force output of virtual tables for ordinary class
  2167.     -vtbl2                  # new improved output algorithm for virtual tables
  2168.     -w                      # suppress warnings
  2169.     -w1                     # generate additional warnings from CFront
  2170.     -w3                     # passed through to C compiler (supresses unused warnings)
  2171.     -y directory            # create temporary files in directory
  2172.     -z0                     # force 'inline' functions to be non-inline
  2173.     -z3                     # supress name encoding of local vars and struct members (default)
  2174.     -z4                     # encode names of local vars and struct members
  2175.     -z6                     # force enums always to be int variables
  2176.     -z7                     # relax requirement on static class member initialization 
  2177.  
  2178. æKY CheckIn
  2179. æC                CheckIn -- check a file into a project
  2180.  
  2181. CheckIn -w | -close | ([options…] files…) > progress
  2182.  -a                 # checkin all files in current directory
  2183.  -b                 # check in files… as branches
  2184.  -c                 # cancel if conflict occurs (avoids dialog)
  2185.  -cf file           # the comment is contained in file.
  2186.  -close             # close the Check In window
  2187.  -cs comment        # a description of changes made to the file
  2188.  -delete            # delete the file after checking it in
  2189.  -m                 # check out the files for modification after checking in
  2190.  -n                 # answer no to all dialogs (avoids dialogs)
  2191.  -new               # add a new file to the project
  2192.  -p                 # write progress information to standard output
  2193.  -project project   # name of project that contains the files
  2194.  -t task            # a short description of task accomplished
  2195.  -touch             # touch the mod date of file after checking in
  2196.  -u user            # name of current user
  2197.  -w                 # open the Check In window
  2198.  -y                 # answer yes to all dialogs (avoids dialogs)
  2199.  
  2200. Status codes returned:
  2201.   0    No errors.
  2202.   1    Syntax error.
  2203.   2    Error in processing.
  2204.   3    System error.
  2205.  
  2206.                            Description
  2207.  
  2208.   Return ownership of the specified files to Projector and save all
  2209.   changes as new revisions. The default is to leave you with a read-only
  2210.   copy of the file.
  2211.  
  2212.   File must be an HFS pathname. Projector determines the project each
  2213.   file belongs to by inspecting the file's resource fork. Since Projector
  2214.   puts the name of the project in the resource fork of checked-out
  2215.   files, files belonging to different projects can be checked in with
  2216.   a single command.
  2217.  
  2218.   If the -a (all) option is used instead of file..., Projector examines
  2219.   all files in the current directory and checks in all files in the
  2220.   current directory that have been checked out for modification. The
  2221.   files are checked into their respective projects.
  2222.  
  2223.   To add a new file to the project, use the -new option.
  2224.  
  2225.   When the file is checked in, Projector automatically increments the
  2226.   revision number by one. For example, if revision 2.17 was checked
  2227.   out, the new revision will be 2.18. To override this, use the ProjectInfo
  2228.   command to find the revision number, increase it by the amount desired,
  2229.   and then check the file in, using the "filename,rev" notation. For
  2230.   example, if file.c revision 2.17 was checked out, you could check
  2231.   it in as file.c,3.0 to jump to the next major revision level.
  2232.  
  2233.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  2234.   symbols used in Projector commands.
  2235.  
  2236.  
  2237.                              Examples
  2238.  
  2239.   CheckIn file.c -cs "added some comments"
  2240.  
  2241.   Check in file.c to the current project. A new revision of file.c
  2242.   is created and the user is left with a read-only copy of the file.
  2243.   The comment is saved with the new revision. Because no revision number
  2244.   is specified, Projector simply increases the revision number by one.
  2245.  
  2246.   CheckIn file.c interface.c,5 -t "Added -x option"
  2247.  
  2248.   -cf commentFile
  2249.  
  2250.   This command checks in two files reading the comment from the file
  2251.   commentFile. The task is also saved with the new revisions. The user
  2252.   is left with read-only copies of the files. The new revision for
  2253.   interface.c is revision 5.
  2254.  
  2255.   CheckIn hd:work:file.c hd:work:main.c -m
  2256.  
  2257.   The files to be checked in are hd:work:file.c and :main.c. After
  2258.   the command executes, the user still has modifiable copies of the
  2259.   files.
  2260.  
  2261.   CheckIn -new file.c
  2262.  
  2263.   To check a new file into the project use the -new option. The above
  2264.   command adds file.c to the current project.
  2265.  
  2266.   CheckOut -project Zoom∫Utilities∫MyProject file.c -m
  2267.  
  2268.   ...edit the file...
  2269.  
  2270.   CheckIn -project Zoom∫Utilities∫MyProject file.c -b
  2271.  
  2272.   The preceding command sequence illustrates the usefulness of the
  2273.   -b option. In this case, the user checked out a write-privileged
  2274.   copy of the latest revision of file.c from the current project, edited
  2275.   the file, and then, using the branch option, checked in the file
  2276.   on a branch.
  2277.  
  2278.  
  2279.                              See also 
  2280.  
  2281.   CheckOut and CheckOutDir.
  2282.  
  2283. æKY CheckOut
  2284. æC              CheckOut -- check a file out from a project
  2285.  
  2286. CheckOut -w | -close | ([options…] files…) > progress
  2287.  -a                    # check out all the files in the current project
  2288.  -b                    # checkout specified files on a new branch
  2289.  -c                    # cancel if conflict occurs (avoids dialog)
  2290.  -cancel               # cancel the checkout of the files
  2291.  -cf file              # the comment is contained in files
  2292.  -close                # close the Check Out window
  2293.  -cs comment           # a short description of changes
  2294.  -d dir                # directory where the checked out files should go
  2295.  -m                    # check out a modifiable copy of the file
  2296.  -n                    # answer no to all dialogs (avoids dialogs)
  2297.  -newer                # checkout latest copy of all files in the project
  2298.  -noTouch              # don't touch the mod date of the checked out files
  2299.  -open                 # open the files after checking out
  2300.  -p                    # write progress information to standard output
  2301.  -project project      # name of project that contains the files
  2302.  -r                    # recursively checkout files
  2303.  -t task               # a short description of task accomplished
  2304.  -u user               # name of current user
  2305.  -update               # checkout latest copy of all files you already have
  2306.  -w                    # open the Check Out window
  2307.  -y                    # answer yes to all dialogs (avoids dialogs)
  2308.  
  2309. Status codes returned:
  2310.   0    No errors.
  2311.   1    Syntax error.
  2312.   2    Error in processing.
  2313.   3    System error.
  2314.  
  2315.                            Description
  2316.  
  2317.   Under Projector, CheckOut obtains copies of file revisions from a
  2318.   project. The default is to check out read-only copies. Unless otherwise
  2319.   specified, copies are placed in the checkout directory associated
  2320.   with the project.
  2321.  
  2322.   If file is a leafname (that is, file.c), Projector checks out the
  2323.   latest revision of the file from the current project. If file specifies
  2324.   a revision (for example, file.c,22), that revision is checked out.
  2325.  
  2326.   If file is a partial or full HFS pathname (that is, :work:file.c
  2327.   or HD:work:file.c), the file does not go into the checkout directory.
  2328.   Instead, Projector checks out the file (that is, file.c) in the current
  2329.   project and places the copy in the specified HFS location (that is,
  2330.   in the :work: or HD:work: directory, respectively).
  2331.  
  2332.   Finally, file may be a Name. See the NameRevisions command for more
  2333.   information about Names. The Name is expanded and the corresponding
  2334.   revisions are checked out.
  2335.  
  2336.   To check out an old revision for modification, you must specify the
  2337.   -b (branch) option.
  2338.  
  2339.   If you are checking out revision 5 of file.c into hd:work and Projector
  2340.   determines that you already have that revision in the work directory,
  2341.   Projector will not recopy the data of revision 5. This is especially
  2342.   nice when you are checking out a revision for modification, and you
  2343.   already have a read-only copy of that revision.
  2344.  
  2345.   See Chapter 7 of MPW manual for complete definitions of the terms and
  2346.   symbols used in Projector commands.
  2347.  
  2348.  
  2349.                              Examples
  2350.  
  2351.   CheckOut -m -project Zoom∫Utilities∫MyProject file.c
  2352.  
  2353.   Checks out a write-privileged copy of the latest revision of file.c
  2354.   from the Zoom∫Utilities∫MyProject project. The file is placed in
  2355.   the checkout directory for the project.
  2356.  
  2357.   CheckOut -m file.c
  2358.  
  2359.   The above command checks out the latest revision of file.c for modification.
  2360.   The file is placed in the checkout directory for the project. If
  2361.   you already happen to have the latest revision of file.c in the checkout
  2362.   directory, then Projector only updates the 'ckid' resource of file.c
  2363.   to indicate that it is now a modifiable file.
  2364.  
  2365.   CheckOut -project Zoom∫Utilities∫Kerfroodi file.c,22
  2366.  
  2367.   The above command checks out a read-only copy of revision 22 of file.c
  2368.   from the Zoom∫Utilities∫Kerfroodi project. The file is placed in
  2369.   the checkout directory for the project.
  2370.  
  2371.   Project Zoom∫Utilities∫Kerfroodi
  2372.  
  2373.   CheckOut file.c -t "Fix Bug 7" -m -d "{Zoom}UtilitiesSrc:Kerfroodi"
  2374.  
  2375.   By setting the current project with the Project command you don’t
  2376.   need to specify a project on subsequent Projector commands. By setting
  2377.   the task other users will be able to see why you have checked out
  2378.   file.c. The files are placed in {Zoom}UtilitiesSrc:Kerfroodi.
  2379.  
  2380.   CheckOut -a -d HD:Work:Test
  2381.  
  2382.   The above example checks out read-only copies of all of the files
  2383.   in the current project and places the copies in the directory HD:work:Test.
  2384.  
  2385.   CheckOut -a -project Zoom∫ -r
  2386.  
  2387.   Checks out read-only copies of all files in the Zoom project and
  2388.   all of its subprojects. Its behavior is the same as if you had executed
  2389.   these commands individually:
  2390.  
  2391.   CheckOut -a -project Zoom∫
  2392.  
  2393.   CheckOut -a -project Zoom∫Voom
  2394.  
  2395.   CheckOut -a -project Zoom∫Utilities
  2396.  
  2397.   CheckOut -a -project Zoom∫Utilities∫MyProject
  2398.  
  2399.   ...
  2400.  
  2401.   You can conveniently update the read-only files (from the current
  2402.   project) in the current directory without affecting any files checked
  2403.   out for modification. To do this, use the -update option:
  2404.  
  2405.   CheckOut -update -d :
  2406.  
  2407.  
  2408.                              See also 
  2409.  
  2410.   CheckIn and CheckOutDir.
  2411.  
  2412. æKY CheckOutDir
  2413. æC  CheckOutDir -- specify the directory where checked out files will placed
  2414.  
  2415. CheckOutDir [-project project | -m] [-r] [-x | directory]
  2416.  -project project # name of project to associate with the checkout directory
  2417.  -m               # list the checkout directories of all root projects
  2418.  -r               # recursively set or display the checkout directories
  2419.  -x               # reset the checkout directories to ":"
  2420.  
  2421. Status codes returned:
  2422.   0    No errors.
  2423.   1    Syntax error.
  2424.   2    Error in processing.
  2425.   3    System error.
  2426.  
  2427.                            Description
  2428.  
  2429.   Under Projector, CheckOutDir changes the checkout directory associated
  2430.   with the current project to the HFS pathname directory. From this
  2431.   point on, files checked out of the named project are placed, by default,
  2432.   into this directory. The directory is created if it does not exist.
  2433.   When a project is mounted, the checkout directory is initially set
  2434.   to ":"—that is, the current directory.
  2435.  
  2436.   It is recommended that you put CheckOutDir commands immediately following
  2437.   the corresponding MountProject commands you place in your UserStartup
  2438.   file, script, or AddMenu for project initialization.
  2439.  
  2440.   If directory is missing, the checkout directory of the current project
  2441.   is written to standard output in the form of a CheckOutDir command.
  2442.  
  2443.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  2444.   symbols used in Projector commands.
  2445.  
  2446.  
  2447.                              Examples
  2448.  
  2449.   CheckOutDir HD:work:Test
  2450.  
  2451.   This command causes subsequent files in the current project to be
  2452.   checked out to the HD:work:Test folder.
  2453.  
  2454.   CheckOutDir
  2455.  
  2456.   CheckOutDir -project Zoom∫Utilities∫Test HD:work:Test
  2457.  
  2458.   The above command outputs the checkout directory of the current project
  2459.   in the form of a CheckOutDir command.
  2460.  
  2461.   CheckOutDir -project Zoom∫ -r
  2462.  
  2463.   CheckOutDir -project Zoom∫ :
  2464.  
  2465.   CheckOutDir -project Zoom∫Vroom :
  2466.  
  2467.   CheckOutDir -project Zoom∫Utilities :
  2468.  
  2469.   CheckOutDir -project Zoom∫Utilities∫Test HD:work:Test
  2470.  
  2471.   The -r option lets you display the checkout directory for the current
  2472.   project and all subprojects. In this case, only the sort project
  2473.   has a checkout directory setting that differs from the default.
  2474.  
  2475.   The -r option can also be used to set the checkout directories of
  2476.   a complex project to mirror the projects own hierarchical structure.
  2477.   For example:
  2478.  
  2479.   CheckOutDir -project Zoom∫ -r HD:Work:
  2480.  
  2481.   After executing the above command, listing the checkout directories
  2482.   for the projects under Zoom yields
  2483.  
  2484.   CheckOutDir -project Zoom∫ -r
  2485.  
  2486.   CheckOutDir -project Zoom∫ HD:work:
  2487.  
  2488.   CheckOutDir -project Zoom∫Vroom HD:Work:Vroom
  2489.  
  2490.   CheckOutDir -project Zoom∫Utilities HD:Work:Utilities
  2491.  
  2492.   CheckOutDir -project Zoom∫Utilities∫Test HD:Work:Utilities:Test
  2493.  
  2494.   Notice how the directory structure is similar to the project structure.
  2495.   The directories are created if they do not exist.
  2496.  
  2497.   The -m option lists the checkout directories of the root projects.
  2498.   For example
  2499.  
  2500.   CheckOutDir -m
  2501.  
  2502.   CheckOutDir -project Zoom∫ HD:Work:Zoom
  2503.  
  2504.   CheckOutDir -project Test∫ HD:Test
  2505.  
  2506.  
  2507.                              See also 
  2508.  
  2509.   MountProject, CheckIn, and CheckOut.
  2510.  
  2511. æKY Choose
  2512. æC   Choose -- choose or list network file server volumes and printers
  2513.  
  2514. Choose [option…] [[zone]:server[:volume] …]
  2515.  -askpw                # ask for server password (in a "safe" dialog box)
  2516.  -askvp                # ask for volume password (in a "safe" dialog box)
  2517.  -c                    # output in the form of further "Choose" commands.
  2518.  -cp                   # print driver name and type of current printer.
  2519.  -dr driverFileName    # name of printer driver file in system folder 
  2520.                        # (e.g. "LaserWriter")
  2521.  -guest                # log-in to the file server as a guest.
  2522.  -list                 # list entities (don't choose them).
  2523.  -p                    # print version information.
  2524.  -pr                   # choose printers (instead of file servers).
  2525.  -pw password          # specify server log-in password.
  2526.  -u username           # specify user name for server log-in.
  2527.  -v                    # verbose (print names of volumes really mounted).
  2528.  -vp volumePassword    # specify volume password (to mount it).
  2529.  -type type            # specify type of entity to list or choose (or '≈').
  2530.  
  2531.  Names take the form     "zone:server:volume"
  2532.  
  2533.  The wildcard '≈' may be used in place of a zone, server, volume or
  2534.  type name.  A leading ':' (empty zone name) or '*:' indicates the
  2535.  current zone.  A name of the form "…server:" will mount all volumes
  2536.  on the server, unless a specific volume name is given.
  2537.  
  2538. Status codes returned:
  2539.   0    No errors.
  2540.   1    Syntax error on command line.
  2541.   3    Any other error.
  2542.  
  2543.                            Description
  2544.  
  2545.   Choose noninteractively mounts or lists the specified AppleShare
  2546.   volumes or printers. Each name takes the form
  2547.  
  2548.   [zone]:[server[:volume]]
  2549.  
  2550.   ("Server" means any file or printer server.) The zone name is always
  2551.   optional and defaults to the current zone. A server name must be
  2552.   preceded by (at least) a colon. Volume names are only applicable
  2553.   to file servers.
  2554.  
  2555.   When mounting file server volumes, a server name is required. If
  2556.   a volume name is specified, only that volume is mounted. If the volume
  2557.   name is omitted, or if it is the wildcard character "≈", all volumes
  2558.   on the server are mounted:
  2559.  
  2560.   [zone]:server:volume
  2561.  
  2562.   [zone]:server[:≈]
  2563.  
  2564.   When -list is specified, the wildcard character "≈" may be used in
  2565.   place of names in all of the fields: "≈" in the zone field expands
  2566.   to all zones; "≈" in the server field expands to all servers in the
  2567.   specified zones; "≈" in the volume-name field expands to volumes
  2568.   on the specified servers (listing volumes on a server requires a
  2569.   server login—that is, as a user with a valid password or as a guest).
  2570.   If the wildcard character "≈" is used, it must be quoted so that
  2571.   the Shell will not expand it.
  2572.  
  2573.   The -list option also expands the next unspecified item in a name.
  2574.   A zone name followed by nothing else expands to a list of servers
  2575.   in that zone, and a server name followed by nothing else expands
  2576.   to a list of volumes on the server.
  2577.  
  2578.   If a "≈", ":" or "" character appears in a server, volume, or zone
  2579.   name, it may be quoted with the character "". This quoting mechanism
  2580.   supplements quoting already performed by the Shell.
  2581.  
  2582.   Any number of volumes may be mounted (though a system-dependent limit
  2583.   exists on the number of active server connections). Only one printer
  2584.   may be chosen at a time, since only one printer can be active.
  2585.  
  2586.   Server and volume passwords are case sensitive. More than one server
  2587.   and volume may be mounted with a single command, but the server and
  2588.   volume passwords must be the same for each, since at most one password
  2589.   of each type may be specified on the command line.
  2590.  
  2591.  
  2592.                              Examples
  2593.  
  2594.   Choose :Linker:Sources
  2595.  
  2596.   Mount the volume Sources on the server Linker, located in the current
  2597.   zone, using the default user name, server password, and volume password.
  2598.  
  2599.   Choose -v -guest 'Systems:Sources:Doc' 'Systems:Games:≈'
  2600.  
  2601.   Mount the volume Doc on the server Sources and every volume on the
  2602.   server Games in the zone Systems as a guest. Print the names of the
  2603.   volumes that are mounted by the command. List the names of all zones.
  2604.   Notice that the wildcard character "≈" is quoted.
  2605.  
  2606.   Choose -list 'Whale Zone:≈' 'Whale Zone:Moby Dick:≈' '≈:'
  2607.  
  2608.   List all file servers in the zone Whale Zone, all volumes on the
  2609.   file server Moby Dick in that zone (after logging in with the default
  2610.   user name and server password) and all zones (with their servers).
  2611.  
  2612.   Choose -pr -list ':≈'
  2613.  
  2614.   Choose -cp -pr Zarf:Kitchen Sink
  2615.  
  2616.   List all printers of the current type in the current zone. Print
  2617.   the name of the currently selected printer, then select the printer
  2618.   called Kitchen Sink in the zone Zarf.
  2619.  
  2620.   Choose -list -type Fortune Cookie Server '≈:≈'
  2621.  
  2622.   List all network entities of type Fortune Cookie Server in all zones.
  2623.  
  2624.  
  2625.                              See also 
  2626.  
  2627.   Unmount and Volumes commands.
  2628.  
  2629.  
  2630.  
  2631. æKY Clear
  2632. æC                     Clear -- clear the selection
  2633.  
  2634. Clear [-c count] selection [window]
  2635.  -c count                # repeat the Clear count times
  2636.  
  2637. Status codes returned:
  2638.   0    At least one instance of selection was found.
  2639.   1    Syntax error.
  2640.   2    Any other errors.
  2641.  
  2642.                            Description
  2643.  
  2644.   Finds selection and deletes its contents. The selection is not copied
  2645.   to the Clipboard. (For a definition of selection, see Chapter 6 of the
  2646.   MPW manual.)
  2647.  
  2648.   If window is specified, the Clear command acts on that window. It’s
  2649.   an error to specify a window that doesn’t exist. If no window is
  2650.   specified, the command operates on the target window (the second
  2651.   window from the front).
  2652.  
  2653.  
  2654.                              Examples
  2655.  
  2656.   Clear §
  2657.  
  2658.   Deletes the current selection. This is like the Clear command in
  2659.   the menu bar, except that the action occurs in the target window
  2660.   rather than the active window.
  2661.  
  2662.   Clear /BEGIN/:/END/
  2663.  
  2664.   Selects everything from the next BEGIN through the following END,
  2665.   and deletes the selection.
  2666.  
  2667.  
  2668.                              See also 
  2669.  
  2670.   Cut and Replace commands.
  2671.  
  2672.   "Selections" in Chapter 6 (see Appendix B for a summary).
  2673.  
  2674. æKY Close
  2675. æC                   Close -- close specified windows
  2676.  
  2677. Close [-y | -n | -c] [ -a | window…]
  2678.  -y                  # save modified windows before closing (avoids dialog)
  2679.  -n                  # don't save any modified windows (avoids dialog)
  2680.  -c                  # cancel if there is a modified window (avoids dialog)
  2681.  -a                  # close all the windows
  2682.  
  2683. Status codes returned:
  2684.   0    No errors.
  2685.   1    Syntax error 
  2686.   2    Any other error, such as "Window not found."
  2687.   4    Cancelled from dialog.
  2688.  
  2689.                            Description
  2690.  
  2691.   Close the window or windows specified by window. If no window is
  2692.   specified, the target window is closed. If changes to the window
  2693.   have not been saved, a dialog box requests confirmation of the Close
  2694.   command. In scripts you can use the -y, -n, or -c option to avoid
  2695.   this interaction. Use the -a option instead of window to close all
  2696.   of the open windows (other than the Worksheet).
  2697.  
  2698.  
  2699.                              Examples
  2700.  
  2701.   Close
  2702.  
  2703.   Closes the target window, prompting the user with a confirmation
  2704.   dialog box if needed.
  2705.  
  2706.   Close -a -y
  2707.  
  2708.   Saves and closes all open windows.
  2709.  
  2710.   Close -n Test.a Test.r
  2711.  
  2712.   Closes the windows Test.a and Test.r without saving any of the changes.
  2713.  
  2714.  
  2715.                              See also 
  2716.  
  2717.   "File Menu" in Chapter 3.
  2718.       
  2719. æKY CMarker
  2720. æC          CMarker -- generate Mark commands for C and C++ function definitions
  2721.                      
  2722. CMarker [option…] [file…]
  2723.  -a[nachronisms]         # suppress anachronisms messages
  2724.  -d[efine] name[=string] # define name to the preprocessor (same as #define)
  2725.      [,name[=string]]… 
  2726.  -e                      # show macro expansion in the listing (default with -ppout)
  2727.  -ext[ensions] on|off    # turn on or off Apple compiler extensions (default on)
  2728.  -errors                 # suppress marking if errors are detected
  2729.  -i[ncludes] pathname    # search for include files in the specified directories (Max of 15)
  2730.      [,pathname],… 
  2731.  -lang[uage] C|"C++"     # specify target sources as either C or C++ (Default is C)
  2732.  -linesize n             # maximum number of characters generated in a single listing line
  2733.  -l[ist[ing]]            # generate a listing of the source to stdout
  2734.  -mc68881                # define the macro name mc68881 as having the value 1
  2735.  -msi                    # mark include (header) files
  2736.  -pp                     # preprocessing only (no markers will be generated)
  2737.  -ppout filename         # write the preprocessor output to the specified filename
  2738.  -p[rogress]             # write version, progress and summary information to stderr
  2739.  -showskipped            # show lines skipped by conditional compilation in the listing output
  2740.  -t                      # display processing time and number of lines to stderr
  2741.  -u[ndefine] name        # undefine the preprocessor symbol name  (same as #undef)
  2742.     [,name]…
  2743.  
  2744. Status codes returned:
  2745.    0   No errors.
  2746.    1   Parameter or option error.
  2747.    2   Execution error.
  2748.    3   Syntax errors.
  2749.    
  2750.                            Description
  2751.  
  2752. CMarker reads the specified C++/ANSI C source file(s), syntax checks them and 
  2753. generates appropriate "Open" and "Mark" MPW commands, which, when executed, 
  2754. will mark the source file(s) at each function definition with the marker name being the 
  2755. name of the function.  It's purpose is to aid in the marking of source files for use with 
  2756. the MPW "marker browser" capability.  CMarker contains a full ANSI C preprocessor 
  2757. and provides options to mark include files, generate source listings (with or without 
  2758. showing macro expansions), run the preprocessor only, flag anachronisms, and syntax 
  2759. check C++/ANSI C with or without Apple extensions.  CMarker runs as an MPW Tool. 
  2760.  
  2761. æKY Commando
  2762. æC          Commando -- present a dialog interface for commands
  2763.  
  2764. Commando [command] [-modify]
  2765.     -modify                 # enable Commando’s built-in editor
  2766.  
  2767. Status codes returned:
  2768.   0    The Do It button was selected.
  2769.   1    The Cancel button was selected.
  2770.   2    Error occurred while parsing the cmdo resource.
  2771.   3    I/O or program error.
  2772.  
  2773.                            Description
  2774.  
  2775.   The Commando interface lets you operate any properly configured MPW
  2776.   tool or script using specialized Macintosh dialog boxes instead of
  2777.   the ordinary command line method. The dialogs make it easy to find
  2778.   options and build up complex command lines.
  2779.  
  2780.   Commands with many options and parameters may employ one or more
  2781.   nested dialog boxes. See "Commando Dialogs" in Chapter 4 of the MPW manual
  2782.   for more information on the basics of using the Commando dialogs. Chapter
  2783.   13 describes the structure of the Commando resource and shows how
  2784.   to create Commando dialogs for your own tools and scripts.
  2785.  
  2786.   The controls of a Commando dialog box, including text fields, buttons,
  2787.   titles, and so on, can be sized and moved within the dialog box by
  2788.   using the mouse, exactly as you would drag an object in the Finder.
  2789.   See "Editing Commando Dialogs" in Chapter 13 for information on moving
  2790.   and sizing controls.
  2791.  
  2792.  
  2793.                              Examples
  2794.  
  2795.   Commando Rez
  2796.  
  2797.   Displays the frontmost Rez dialog box shown under "Rez" in Part II.
  2798.  
  2799.   Rez…
  2800.  
  2801.   Displays the frontmost Rez dialog box shown under "Rez" in Part II,
  2802.   exactly as in the previous example.
  2803.  
  2804.  
  2805.                              See also 
  2806.  
  2807.   "Invoking Commando" in Chapter 4.
  2808.  
  2809.   Chapter 13.
  2810.  
  2811. æKY Compare
  2812. æC                    Compare -- compare text files
  2813.  
  2814. Compare [option…] file1 [file2]  < file2 > differences ≥ progress
  2815.  -b                      # treat several blanks or tabs as a single blank
  2816.  -c c1-c2[,c1-c2]        # compare only specified columns
  2817.  -d depth                # maximum stack depth
  2818.  -e context              # display specified number of context lines
  2819.  -g groupingFactor       # grouping factor (matching lines for resync)
  2820.  -h width                # write differences horizontally
  2821.  -l                      # lower case (i.e. ignore case differences)
  2822.  -m                      # suppress displays of mismatched lines 
  2823.  -n                      # don't write to output if files match
  2824.  -p                      # write progress information to diagnostics
  2825.  -s                      # use static grouping factor
  2826.  -t                      # ignore trailing blanks
  2827.  -v                      # suppress line numbers in vertical displays
  2828.  -x                      # don't expand tabs
  2829.  
  2830. Status codes returned:
  2831.   0    Files match.
  2832.   1    Parameter or option error.
  2833.   2    Files don’t match.
  2834.  
  2835.                            Description
  2836.  
  2837.   Compares the lines of two text files and writes their differences
  2838.   to standard output. Options are provided to compare a specific column
  2839.   range in each file
  2840.  
  2841.   (-c), to ignore blanks (-b), and to ignore case (-l).
  2842.  
  2843.   Both files are read and compared line for line. As soon as a mismatch
  2844.   is found, the two mismatched lines are stored in two stacks, one
  2845.   for each file. Lines are then read alternately (starting from the
  2846.   next input line in file2 ) until a match is found to put the files
  2847.   back in synchronization. If such a match is found, Compare writes
  2848.   the mismatched lines to standard output.
  2849.  
  2850.   Files are considered resynchronized when a certain number of lines
  2851.   in the two stacks exactly match. By default, the number of lines,
  2852.   called the grouping factor, is defined by the formula
  2853.  
  2854.   G = Trunc((2.0 * Log10(M)) + 2.0)
  2855.  
  2856.   where G is the grouping factor and M is the number of lines saved
  2857.   in each stack so far. This definition requires more lines to be the
  2858.   same after larger mismatches. Using this formula, the following table shows
  2859.   the grouping factor G as a function of the number of mismatched lines:
  2860.  
  2861.   M: Number of G: Grouping
  2862.  
  2863.   mismatched lines factor
  2864.  
  2865.   1 to 3 2
  2866.  
  2867.   4 to 9 3
  2868.  
  2869.   10 to 31 4
  2870.  
  2871.   32 to 99 5
  2872.  
  2873.   100 to 315 6
  2874.  
  2875.   316 to 999 7
  2876.  
  2877.   1000 to 3161 8
  2878.  
  2879.   3162 to 9999 9
  2880.  
  2881.   With the default dynamic grouping, the -g option sets the lower limit
  2882.   for G (which must be at least 2, because the formula is always applied).
  2883.   The -s option lets you fix G as a static constant. A static G may
  2884.   be desirable under some circumstances, but may also resynchronize
  2885.   the files at undesirable points, especially if G is too small. It’s
  2886.   recommended that you use the default (dynamic G ) first; if the results
  2887.   aren’t satisfactory, try a higher minimum value of dynamic G (such
  2888.   as 3 or 4). If that is still unsatisfactory, try the static G option.
  2889.  
  2890.   With either option, there’s a limit on the depth of the stacks— that
  2891.   is, on how far out of synchronization the two files can get before
  2892.   they’re no longer worth comparing. For a dynamic G, the limit on
  2893.   the number of mismatched lines is 1000, but you can choose a lower
  2894.   limit with the -d option. For the static G option, typical values
  2895.   for G are 1 to 5, and the stack depth should be between about 10
  2896.   and 50 (the default limit is 25).
  2897.  
  2898.  
  2899.                              Examples
  2900.  
  2901.   Compare File File.bak > Mismatches
  2902.  
  2903.   Compares File and File.bak, writing the results to the file Mismatches.
  2904.   No options are specified, so dynamic grouping is used, blanks are
  2905.   retained, tabs are expanded into spaces, and matching is case sensitive.
  2906.  
  2907.   Compare File.old.§ File.new.§
  2908.  
  2909.   Compares the selected portions of the two windows and writes out
  2910.   the results.
  2911.  
  2912.   Limitations Compare can handle text files with a maximum line length
  2913.   of 255 characters.
  2914.  
  2915.   The text files compared should be fewer than 9999 lines long, because
  2916.   the displays are formatted based on four-digit line numbers.
  2917.  
  2918.  
  2919.                              See also 
  2920.  
  2921.   Equal command (Equal is a quicker command that tells you whether
  2922.   files are different, but stops at the first byte at which they differ).
  2923.  
  2924. æKY CompareFiles
  2925. æC  CompareFiles -- compare text files and interactively view differences
  2926.  
  2927. CompareFiles [-9 | -13 | -b x y | -Portrait | -TwoPage] oldFile newFile
  2928.  -9                      # assume a screen size of 512 x 342
  2929.  -13                     # assume a screen size of 640 x 480
  2930.  -b x y                  # tile windows into the rectangle specified by x y
  2931.  -Portrait               # screen size for Apple Macintosh Portrait Display
  2932.  -TwoPage                # screen size for Apple Two-Page Monochrome Monitor
  2933.  
  2934. Status codes returned:
  2935.   0    The files match.
  2936.   1    Syntax error.
  2937.   2    The files differ.
  2938.  
  2939.                            Description
  2940.  
  2941.   CompareFiles compares two text files (using the tool Compare) and,
  2942.   if there are any differences, displays the file in adjacent windows
  2943.   for interactively viewing the differences. A menu will be appended
  2944.   to the menu bar to go through the changes.
  2945.  
  2946.   When all the changes have been shown, the windows will be closed
  2947.   (if they were closed when CompareFiles started) and the menu will
  2948.   be deleted.
  2949.  
  2950.   The Compare menu contains four items for viewing and editing the
  2951.   differences. The items perform the following actions:
  2952.  
  2953.   Find Next Change Finds the next difference and highlights the changes
  2954.   in each window. (Notice that the differences are shown from bottom
  2955.   to top. This is so editing changes will not affect the file offsets
  2956.   recorded from the Compare tool.)
  2957.  
  2958.   Copy Selection »» Replaces the changed text in the new file with
  2959.   the old text.
  2960.  
  2961.   Copy Selection «« Replaces the old text with the changed text from
  2962.   the new file.
  2963.  
  2964.   Done Closes the files (asking if you want to save changes) and deletes
  2965.   the Compare menu. Use this item to close all the windows and delete
  2966.   the menu. (If you close any of the windows yourself, they will not
  2967.   be restored to their previous size and position.)
  2968.  
  2969.   The figure below shows the CompareFiles menu.
  2970.  
  2971.  
  2972.  
  2973.  
  2974.                              Examples
  2975.  
  2976.   CompareFiles Sample.old Sample.c
  2977.  
  2978.   Compares the file Sample.c to Sample.old. If there are some differences,
  2979.   those two files are opened side by side on the screen.
  2980.  
  2981.   CompareFiles -b 1024 1024 Sample.old Sample.c
  2982.  
  2983.   Compares the file Sample.c to Sample.old. If there are differences,
  2984.   the files are opened and tiled into a 1024 by 1024 rectangle.
  2985.  
  2986.  
  2987.                              See also 
  2988.  
  2989.   Compare Tool.
  2990.  
  2991. æKY CompareRevisions
  2992. æC   CompareRevisions -- compare two revisions of a file in a project
  2993. CompareRevisions file…
  2994.  
  2995. Status codes returned:
  2996.   0    No Errors.
  2997.   1    Syntax Error.
  2998.   2    Error in Processing.
  2999.   3    System Error.
  3000.  
  3001.                            Description
  3002.  
  3003.   Compare the revision of the HFS file file with another revision of
  3004.   that same file.
  3005.  
  3006.   CompareRevisions uses the ProjectInfo command to determine what project
  3007.   file belongs to and what its revision is. CompareRevisions then displays
  3008.   a list of the other revisions of the file for the user to choose.
  3009.   CompareRevisions checks this other revision out and calls the CompareFiles
  3010.   script to display both revisions on the screen and to highlight the
  3011.   differences between them. CompareFiles puts up an AddMenu named Compare
  3012.   to help you step through the differences between the two revisions.
  3013.  
  3014.   The file must belong to a currently mounted project. If the project
  3015.   that the file belongs to is not currently mounted, CompareRevisions
  3016.   displays an Alert.
  3017.  
  3018.   CompareRevisions uses the CompareFiles script.
  3019.  
  3020.  
  3021.                              Examples
  3022.  
  3023.   CompareRevisions file.c
  3024.  
  3025.   This example compares the revision in HFS file "file.c" in the working
  3026.   directory with any other revisions of file.c in the project.
  3027.  
  3028.   AddMenu Project 'Compare Revisions' 'CompareRevisions {Active} ∑∑ {WorkSheet}'
  3029.  
  3030.   This example adds CompareRevisions to the Project menu and allows
  3031.   you to compare revisions by opening the file you wish to compare
  3032.   and then selecting the 'Compare Revisions' menu item in the Project
  3033.   menu.
  3034.  
  3035.  
  3036.                              See also 
  3037.  
  3038.   CompareFiles.
  3039.  
  3040. æKY Confirm
  3041. æC             Confirm -- display a confirmation dialog box
  3042.  
  3043. Confirm [-t] [message…] < file
  3044.  -t                      # three buttons (Yes, No, Cancel)
  3045.  
  3046. Status codes returned:
  3047.   0    The OK button was selected.
  3048.   1    Syntax error.
  3049.   4    The Cancel button was selected or the No button was clicked in a three-way    dialog box.
  3050.   5    The Cancel button was selected in a three-way dialog box; see the -t option.
  3051.  
  3052.                            Description
  3053.  
  3054.   Confirm displays a confirmation dialog box with OK and Cancel buttons
  3055.   and the prompt message. There is no output to this command: the result
  3056.   of the dialog is returned in the {Status} variable.
  3057.  
  3058.   Note: Because Confirm returns a nonzero status value to indicate
  3059.   that No or Cancel was selected, a script should set the Shell variable
  3060.   {Exit} to zero before executing the Confirm command. (This step is
  3061.   necessary because the Shell aborts script processing when a nonzero
  3062.   status value is returned and {Exit} is nonzero.)
  3063.  
  3064.  
  3065.                              Examples
  3066.  
  3067.   Set Exit 0
  3068.   Confirm "Replace files with the same name? "
  3069.   If {Status} == 0
  3070.     Duplicate -y Source:≈ Destination:
  3071.   End
  3072.   Set Exit 1
  3073.  
  3074.   The following confirmation dialog box will be displayed:
  3075.  
  3076. æKY Continue
  3077. æC        Continue -- continue with next iteration of For or Loop
  3078.  
  3079. Continue [If expression]
  3080. Status codes returned:
  3081.    0   No errors.
  3082.   –3   Error in parameters, or Continue not within For…End or Loop…End.
  3083.   –5   Invalid expression.
  3084.  
  3085.                            Description
  3086.  
  3087.   If expression is nonzero, Continue terminates this iteration of the
  3088.   immediately enclosing For or Loop command and continues with the
  3089.   next iteration. (Null strings evaluate to zero.) If the "If expression"
  3090.   clause is omitted, the Continue is unconditional. If no further iterations
  3091.   are possible, the For or Loop is terminated. (For a definition of
  3092.   expression, see the Evaluate command.)
  3093.  
  3094.  
  3095.                              Examples
  3096.  
  3097.   Set Exit 0
  3098.   Set list ""
  3099.   For file In `files -t TEXT`
  3100.     Confirm -t "Print file {file}?"
  3101.     Set SaveStatus {Status}
  3102.     Continue If {SaveStatus} == 4 # No
  3103.     Break If {SaveStatus} == 5 # Cancel
  3104.     Set list "{list} '{file}'" # YesEnd
  3105.   End
  3106.   Print {PrintOptions} {list}
  3107.   Set Exit 1
  3108.  
  3109.   In this example, the Continue command is executed if the user selects
  3110.   No (status value 4). The Continue causes the current file to be skipped, but
  3111.   processing continues with the next file in the list.
  3112.  
  3113.   (For a full explanation of this example, refer to the Confirm command.)
  3114.  
  3115.  
  3116.                              See also 
  3117.  
  3118.   For, Loop, Break, and If commands.
  3119.  
  3120.   Evaluate command, for a description of expressions.
  3121.  
  3122.   "Structured Commands" in Chapter 5.
  3123.  
  3124. æKY Copy
  3125. æC                  Copy -- copy selection to Clipboard
  3126.  
  3127. Copy [-c count] selection [window]
  3128.  -c count                # copy the nth selection, where n = count
  3129.  
  3130. Status codes returned:
  3131.   0    At least one instance of the selection was found.
  3132.   1    Syntax error.
  3133.   2    Any other error.
  3134.  
  3135.                            Description
  3136.  
  3137.   Finds selection in the specified window and copies it to the Clipboard,
  3138.   replacing the previous contents of the Clipboard. If no window is
  3139.   specified, the command operates on the target window (the second
  3140.   window from the front). It’s an error to specify a window that doesn’t
  3141.   exist.
  3142.  
  3143.   For a definition of selection, see "Selections" in Chapter 6 of the MPW
  3144.   manual; a summary
  3145.   of the selection syntax is contained in Appendix B.
  3146.  
  3147.     • Note: To copy files, use the Duplicate command.
  3148.  
  3149.  
  3150.                              Examples
  3151.  
  3152.   Copy §
  3153.  
  3154.   Copies the current selection to the Clipboard. This command is like
  3155.   the Copy command in the Edit menu, except that the action takes place
  3156.   in the target window.
  3157.  
  3158.   Copy /BEGIN/:/END/
  3159.  
  3160.   Selects everything from the next BEGIN through the following END
  3161.   and copies this selection to the Clipboard.
  3162.  
  3163.  
  3164.                              See also 
  3165.  
  3166.   Cut and Paste commands.
  3167.  
  3168.   "Selections" in Chapter 6 and Appendix B.
  3169.  
  3170.  
  3171. æKY Count
  3172. æC                  Count -- count lines and characters
  3173.  
  3174. Count [-l] [-c] [file…]  < file > counts
  3175.  -l                      # write only line counts
  3176.  -c                      # write only character counts
  3177.  
  3178. Status codes returned:
  3179.   0    No errors.
  3180.   1    Error in parameters.
  3181.   2    Unable to open input file.
  3182.  
  3183.                            Description
  3184.  
  3185.   Counts the lines and characters in its input and writes the results
  3186.   to standard output. If no files are specified, standard input is
  3187.   read. If more than one file is specified, separate counts are printed
  3188.   for each file, one per line and preceded by the filename. A total
  3189.   is printed following the list.
  3190.  
  3191.  
  3192.                              Examples
  3193.  
  3194.   Count MakeFile.c Count.c
  3195.  
  3196.   Displays line counts and character counts in the form
  3197.  
  3198.   MakeFile.c 43 981
  3199.   Count.c 153 3327
  3200.   Total 196 4303
  3201.  
  3202.   Files | Count -l
  3203.  
  3204.   Displays the total number of files and directories in the current
  3205.   directory.
  3206.  
  3207.   Count -l §
  3208.  
  3209.   Displays the number of lines selected in the target window.
  3210.  
  3211.     • Note: The source code for Count is included in the CExamples
  3212.     folder in the file Count.c, as part of MPW C.
  3213.  
  3214. æKY CPlus
  3215. æC                CPlus -- script to compile C++ source
  3216.  
  3217. CPlus [option…] [file…] < file > intermediate output ≥ progress
  3218.     -a                      # force ANSI-style intermediate C code (default)
  3219.     -a0                     # force K&R-style (pre-ANSI) intermediate C code
  3220.     -a1                     # force ANSI-style intermediate C code (default)
  3221.     -b                      # put string constants into code and generate PC-relative references
  3222.     -b2                     # implies '-b' above, and allows string constants to be overlaid
  3223.     -b3                     # overlaid string constants in code (but not PC-relative refs.)
  3224.     -c                      # intermediate code to standard output; no object file
  3225.     -d name                 # equivalent to: #define name 1
  3226.     -d name=string          # equivalent to: #define name string
  3227.     -e                      # write preprocessor results to output
  3228.     -e2                     # implies '-e' above, and strips comments
  3229.     -elems881               # generate MC68881 code for transcendentals
  3230.     -f filename             # act as if input comes from named file when it actually is from stdin 
  3231.     -f1                     # send text version of C code to C compiler (no token stream)
  3232.     -i directory            # search for includes in directory
  3233.     -m                      # generate 32-bit references for data (less efficient code)
  3234.     -mbg ch8                # MPW 2.0 compatible macsbug symbols
  3235.     -mbg off                # no macsbug symbols in the code (link/unlk only if necessary)
  3236.     -mbg on|full            # full macsbug symbols
  3237.     -mbg <n>                # macsbug symbols to length <n> (<n> can be 0..63)
  3238.     -mc68020                # generate MC68020 code 
  3239.     -mc68881                # generate MC68881 code for arithmetic operations
  3240.     -mtbl0                  # suppress output of method tables for Object Pascal Classes
  3241.     -mtbl1                  # force output of method tables for Object Pascal Classes
  3242.     -n                      # Turn pointer assignment incompatibilty errors into warnings
  3243.     -o objname              # generate code in file or directory objname
  3244.     -p                      # write progress information to diagnostic
  3245.     -s segment              # generate code in segment
  3246.     -sym off                # no SADE records
  3247.     -sym on|full            # full SADE records; can modify with [,nolines] [,notypes] [,novars]
  3248.     -t                      # write C compilation time to diagnostic
  3249.     -u name                 # equivalent to: #undef name
  3250.     -vtbl0                  # suppress output of virtual tables for ordinary class
  3251.     -vtbl1                  # force output of virtual tables for ordinary class
  3252.     -vtbl2                  # new improved output algorithm for virtual tables
  3253.     -w                      # suppress warnings
  3254.     -w1                     # generate additional warnings from CFront
  3255.     -w3                     # passed through to C compiler (supresses unused warnings)
  3256.     -y directory            # create temporary files in directory
  3257.     -z0                     # force 'inline' functions to be non-inline
  3258.     -z3                     # supress name encoding of local vars and struct members (default)
  3259.     -z4                     # encode names of local vars and struct members
  3260.     -z6                     # force enums always to be int variables
  3261.     -z7                     # relax requirement on static class member initialization 
  3262.  
  3263. Status codes returned:
  3264.   0    Successful completion.
  3265.   1    Errors occurred.
  3266.  
  3267.                            Description
  3268.  
  3269.   CPlus compiles the specified C++ source file. Compiling file Name.cp
  3270.   creates object file Name.cp.o. (By convention, C++ source filenames
  3271.   end in a ".cp" suffix.) If no filenames are specified, standard input
  3272.   is compiled and the object file "c.o" is created.
  3273.  
  3274.   (Note that SADE object file information cannot be generated for standard
  3275.   input source files.)
  3276.  
  3277.   The CPlus script activates, in turn, CFront, and the MPW C Compiler.
  3278.   (CFront consists of two components: a C preprocessor and a C++ to
  3279.   C translator.)
  3280.  
  3281.   See the MPW 3.0 C++ Reference Manual for details of the MPW C++ language
  3282.   definition.
  3283.  
  3284.  
  3285.                              Examples
  3286.  
  3287.   cplus -p Sample.c
  3288.  
  3289.   Compiles Sample.c, producing the object file Sample.c.o. Writes progress
  3290.   information to diagnostic output. (Sample.c is found in Examples:CPlusExamples.)
  3291.  
  3292.  
  3293.                              See also 
  3294.  
  3295.   MPW 3.0 C Reference, MPW C++ Reference.
  3296.  
  3297. æKY CreateMake
  3298. æC                CreateMake -- create a simple makefile
  3299.  
  3300. CreateMake [ -Application [ -c creator ] | -Tool | -DA | SIOW
  3301.          -CR -m mainEntryPoint -rt resourceType | -SIOW 
  3302.          [ -t type ] [ -c creator ] ] [-sym on]
  3303.          [-mc68020 | -mc68881 | -elems881] program file…
  3304.     -Application        # create an Application (default)
  3305.     -c creator          # optional Creator for Application or Code Resource
  3306.     -Tool               # create a Tool
  3307.     -DA                 # create a Desk Accessory
  3308.     -CR                 # create a Code Resource
  3309.     -SIOW               # create a Simple Input/Output Window
  3310.     -m mainEntryPoint   # required Main Entry Point for Code Resource
  3311.     -rt resourceType    # required Resource Type for Code Resource
  3312.     -t type             # optional File Type for Code Resource
  3313.     -sym on             # include SADE information in the object file
  3314.     -mc68020            # generate 68020 instructions
  3315.     -mc68881            # generate 68881 instructions for elementary operations
  3316.     -elems881           # generate 68881 instructions for transcendental functions
  3317.  
  3318. Status codes returned:
  3319.   0    Successful completion.
  3320.   1    Parameter or option error.
  3321.  
  3322.                            Description
  3323.  
  3324.   CreateMake creates a simple makefile for building the specified program.
  3325.   The parameter program is the name of the program. Makefile program.make
  3326.   is created. The list of files includes both source and library files.
  3327.   Source files may be written in any combination of assembly language
  3328.   (suffix ".a"), C (".c"), C++ (".cp"), Pascal (".p"), and/or Rez (".r").
  3329.  
  3330.   You can also specify Library files (suffix ".o"). Link the program
  3331.   with these files. CreateMake automatically links with the library
  3332.   files listed below. It is not necessary to specify these files as
  3333.   parameters to CreateMake.
  3334.  
  3335.   You can create Makefiles for building applications (the default),
  3336.   desk accessories, and tools.
  3337.  
  3338.   CreateMake generates commands that link the program with the following
  3339.   set of MPW libraries:
  3340.  
  3341.     • Inside Macintosh Interfaces
  3342.         {Libraries}Interface.o
  3343.     • Runtime support—one of the following:
  3344.         {Libraries}Stubs.o # a tool is to be built
  3345.         {Libraries}Runtime.o # no C object files
  3346.         {CLibraries}CRuntime.o # any C object files
  3347.     • C Libraries—if any source is in C
  3348.         {CLibraries}StdCLib.o
  3349.         {CLibraries}CSANELib.o
  3350.         {CLibraries}Math.o
  3351.         {CLibraries}CInterface.o
  3352.     • C Libraries—if any source is in C++
  3353.         {CLibraries}CPlusStreams.o # a tool is to be built
  3354.         {CLibraries}CPlusStubs.o # a DA is to be built
  3355.         {CLibraries}CSANELib.o
  3356.         {CLibraries}Math.o
  3357.         {CLibraries}CInterface.o
  3358.     • Pascal Libraries—if any source is in Pascal
  3359.         {PLibraries}PasLib.o
  3360.         {PLibraries}SANELib.o
  3361.     • For tools:
  3362.         {Libraries}ToolLibs.o
  3363.     • For desk accessories:
  3364.         {Libraries}DRVRRuntime.o
  3365.  
  3366.   CreateMake does not include dependencies on include files and USES
  3367.   files in the makefile. Libraries other than those listed above are
  3368.   not included in the Link command generated by CreateMake, unless
  3369.   specified as parameters. CreateMake is used to implement the Create
  3370.   Build Commands item in the Build menu.
  3371.  
  3372.  
  3373.                              Examples
  3374.  
  3375.   CreateMake -tool count count.c count.r
  3376.  
  3377.   Creates the makefile Count.make containing commands for building
  3378.   the tool Count from the source files Count.c and Count.r. The makefile
  3379.   is similar to the following:
  3380.  
  3381.   # File: count.make
  3382.   # Target: count
  3383.   # Sources: count.c count.r
  3384.   # Created: Thursday, June 2, 1988 5:33:38 PM
  3385.  
  3386.   count.c.o ƒ count.make count.c
  3387.       C count.c
  3388.  
  3389.   count ƒƒ count.make count.r
  3390.       Rez count.r -append -o count
  3391.  
  3392.   SOURCES = count.c count.r
  3393.   OBJECTS = count.c.o
  3394.  
  3395.   count ƒƒ count.make {OBJECTS}
  3396.  
  3397.       Link -w -t MPST -c ‘MPS ’ ∂
  3398.           "{Libraries}"Stubs.o ∂
  3399.           "{CLibraries}"CRuntime.o ∂
  3400.           "{Libraries}"Interface.o ∂
  3401.           "{CLibraries}"StdCLib.o ∂
  3402.           "{CLibraries}"CSANELib.o ∂
  3403.           "{CLibraries}"Math.o ∂
  3404.           "{CLibraries}"CInterface.o ∂
  3405.           "{Libraries}"ToolLibs.o ∂
  3406.           "{OBJECTS}" ∂
  3407.           -o count
  3408.  
  3409.  
  3410.                              See also 
  3411.  
  3412.   BuildMenu and BuildProgram commands.
  3413.  
  3414.   "Building a Program: An Introduction" in Chapter 2.
  3415.  
  3416.  
  3417. æKY Cut
  3418. æC           Cut -- copy selection to Clipboard and delete it
  3419.  
  3420. Cut [-c count] selection [window]
  3421.  -c count                # cut the next count selections
  3422.  
  3423. Status codes returned:
  3424.   0    At least one instance of the selection was found.
  3425.   1    Syntax error.
  3426.   2    Any other error.
  3427.  
  3428.                            Description
  3429.  
  3430.   Finds selection in the specified window, copies its contents to the
  3431.   Clipboard, and then deletes the selection. If no window is specified,
  3432.   the command operates on the target window (the second window from
  3433.   the front). It’s an error to specify a window that doesn’t exist.
  3434.  
  3435.   For a definition of selection, see "Selections" in Chapter 6 of the MPW
  3436.   manual; a summary of the selection syntax is contained in Appendix B.
  3437.  
  3438.  
  3439.                              Examples
  3440.  
  3441.   Cut §
  3442.  
  3443.   Cuts the current selection in the target window. (This is the same
  3444.   as the Cut menu item, except that it operates on the target window
  3445.   rather than the active window.)
  3446.  
  3447.   Cut /BEGIN/:/END/
  3448.  
  3449.   Selects everything from the next BEGIN through the following END,
  3450.   copies the contents of the selection to the Clipboard, and then deletes
  3451.   the selection.
  3452.  
  3453.  
  3454.                              See also 
  3455.  
  3456.   Clear, Copy, and Paste commands.
  3457.  
  3458.   "Selections" in Chapter 6 and in Appendix B.
  3459.  
  3460. æKY Date
  3461. æC                    Date -- write the date and time
  3462.  
  3463. Date ([-a | -s] [-d | -t] [-c seconds]) | [-n] > date
  3464.   -a                       # abbreviated date (e.g. Wed, Jun 18, 1986)
  3465.   -s                       # short date (e.g. 6/18/86)
  3466.   -d                       # write date only
  3467.   -t                       # write time only
  3468.   -c seconds               # write date corresponding to seconds
  3469.   -n                       # write seconds since January 1, 1904
  3470.  
  3471. Status codes returned:
  3472.   0    No error.
  3473.   1    Syntax error.
  3474.  
  3475.                            Description
  3476.  
  3477.   Writes the current date and time to standard output in a variety
  3478.   of standard and user-specified formats. Date arithmetic is supported
  3479.   with the -n and -c options that work with the number of seconds since
  3480.   January 1, 1904. With no options the Date output has this form: Thursday,
  3481.   August 30, 1988 10:45:51 A.M.
  3482.  
  3483.  
  3484.                              Examples
  3485.  
  3486.   Date
  3487.  
  3488.   returns the date in the form
  3489.   Friday, February 14, 1988 10:34:25 PM
  3490.  
  3491.   Date -a
  3492.  
  3493.   returns
  3494.   Fri, Feb 14, 1988 10:34:25 PM
  3495.  
  3496.   Date -s -d
  3497.  
  3498.   returns
  3499.   2/14/86
  3500.  
  3501.   Set starttime `Date -n`
  3502.   BuildMyProgram
  3503.   Set endTime `Date -n`
  3504.   Echo Total time for BuildMyProgram ∂
  3505.   `Evaluate {endTime} - {startTime}`
  3506.  
  3507.   This example demonstrates how date arithmetic may be used to show
  3508.   how long a tool or script takes to execute.
  3509.  
  3510. æKY Delete
  3511. æC                Delete -- delete files and directories
  3512.  
  3513. Delete [-y | -n | -c] [-i] [-p] name…  ≥ progress
  3514.  -y                # delete directory contents (avoids dialog)
  3515.  -n                # don't delete directory contents (avoids dialog)
  3516.  -c                # cancel if a directory is to be deleted (avoids dialog)
  3517.  -i                # ignore errors (no diagnostics)
  3518.  -p                # write progress information to diagnostics
  3519.   
  3520. Status codes returned:
  3521.   0    All specified objects were deleted (except for any directories skipped 
  3522.        with the -n option).
  3523.   1    Syntax error.
  3524.   2    An error occurred during the delete.
  3525.   4    Cancel was selected or implied by the -c option.
  3526.  
  3527.                            Description
  3528.  
  3529.   Deletes file or directory name. If name is a directory, name and
  3530.   its contents (including all subdirectories) are deleted.
  3531.  
  3532.   Before deleting directories, a dialog box will request confirmation
  3533.   for the deletion. Use the -y, -n, or -c options in scripts to avoid
  3534.   this interaction. Be sure to see the warning at the end of this section.
  3535.  
  3536.  
  3537.                              Examples
  3538.  
  3539.   Delete HD:MPW:≈.c
  3540.  
  3541.   Deletes all items in the MPW folder that end in ".c". (Recall that
  3542.   the Shell first replaces the parameter "≈.c" with a list of filenames
  3543.   matching the pattern—the Delete command then deletes each of these
  3544.   files.)
  3545.  
  3546.   Warning Beware of potentially disastrous typographical mistakes such
  3547.   as the following:
  3548.  
  3549.   Delete ≈ .c
  3550.  
  3551.   Note the space after "≈"—this space causes "≈" and ".c" to be treated
  3552.   as two separate parameters. In this case, Delete deletes all files
  3553.   in the current directory and also attempts to delete a file named
  3554.   ".c".
  3555.  
  3556.   Also note that the following command deletes everything:
  3557.  
  3558.   Delete ≈:
  3559.  
  3560.   That is, the filename pattern ≈: expands to the names of all volumes
  3561.   online (including the startup volume!).
  3562.  
  3563.   When deleting files en masse, it’s a good practice to use the Echo
  3564.   command to verify the action of the filename generation operators;
  3565.   for example,
  3566.  
  3567.   Echo ≈.c
  3568.  
  3569.  
  3570.                              See also 
  3571.  
  3572.   Clear command (for deleting selections).
  3573.  
  3574.   "Filename Generation" in Chapter 5.
  3575.  
  3576. æKY DeleteMenu
  3577. æC        DeleteMenu -- delete user-defined menus and menu items
  3578.  
  3579. DeleteMenu [menuName [itemName]]
  3580.  
  3581. Status codes returned:
  3582.   0    No errors.
  3583.   1    Syntax error.
  3584.   2    Other errors.
  3585.  
  3586.                            Description
  3587.  
  3588.   Deletes the user-defined item itemName in the menu menuName. If itemName
  3589.   is omitted, all user-defined items for menuName are deleted.
  3590.  
  3591.   Caution If itemName and menuName are both omitted, all user-defined
  3592.   items are deleted. Menu items that haven’t been added with AddMenu
  3593.   can’t be deleted with DeleteMenu.
  3594.  
  3595.  
  3596.                              Examples
  3597.  
  3598.   DeleteMenu File
  3599.  
  3600.   Deletes all user-defined items from the File menu.
  3601.  
  3602.  
  3603.                              See also 
  3604.  
  3605.   AddMenu command. 
  3606.  
  3607. æKY DeleteNames
  3608. æC           DeleteNames -- delete user-defined symbolic names
  3609.  
  3610. DeleteNames [-u user] [-private] [-project project] [-public] [-r] [names… | -a]
  3611.   -u user                 # name of current user
  3612.   -private                # delete private names
  3613.   -project project        # name of project that contains the files
  3614.   -public                 # delete public names
  3615.   -r                      # delete names recursively
  3616.   -a                      # delete all names
  3617.  
  3618. Status codes returned:
  3619.   0    No errors.
  3620.   1    Syntax error.
  3621.   2    Error in processing.
  3622.  
  3623.                            Description
  3624.  
  3625.   Delete symbolic names used to represent a set of revisions under
  3626.   Projector. You can create symbolic names by using the NameRevisions
  3627.   command.
  3628.  
  3629.   You can use the -log option of the ProjectInfo command to see which
  3630.   names have been deleted and what their values were.
  3631.  
  3632.   See Chapter 7 of MPW Manual for complete definitions of the terms and 
  3633.   symbols used in Projector commands.
  3634.  
  3635.  
  3636.                              Examples
  3637.  
  3638.   Suppose you have created a Name "Work" that is expanded to the
  3639.   files file.c and interactive.c using the command
  3640.  
  3641.   NameRevisions Work file.c interactive.c
  3642.  
  3643.   Then:
  3644.  
  3645.   DeleteNames Work
  3646.  
  3647.   removes "Work" from the list of symbolic names.
  3648.  
  3649.  
  3650.                              See also 
  3651.  
  3652.   NameRevisions, ProjectInfo.
  3653.  
  3654.  
  3655. æKY DeletePane
  3656. æC                          DeletePane --  delete panes from the window
  3657.  
  3658. DeletePane [-p paneSpec | -a] [window]
  3659.      -p paneSpec            # choose a  pane to delete
  3660.      -a                     # reset the window to one pane
  3661.  
  3662.       Note: paneSpec is an alternating catenation of strings of the 
  3663.       form cm and rn, where m is a column ordinal and n is a row ordinal.
  3664.  
  3665.  
  3666. æKY DeleteRevisions
  3667. æC  DeleteRevisions -- delete previous revisions of files in a project
  3668.  
  3669. DeleteRevisions [-u user] [-project project] [-file] [-y] revision…
  3670.     -u user                 # name of current user
  3671.     -project project        # name of project that contains the files
  3672.     -file                   # deletes the file and all its revisions
  3673.     -y                      # delete the file/revision (avoids dialog)
  3674.  
  3675. Status codes returned:
  3676.   0    No errors.
  3677.   1    Syntax error.
  3678.   2    Error in processing.
  3679.   3    System error.
  3680.  
  3681.                            Description
  3682.  
  3683.   Delete old revisions by specifying the oldest revision that you want
  3684.   to keep. All prior revisions are deleted. Delete all revisions on
  3685.   a branch by naming the branch or branches in the named files under
  3686.   Projector. It is an error to try to delete a revision that is currently
  3687.   checked out for modification.
  3688.  
  3689.   Revision is either a filename, a filename followed by a comma and
  3690.   a revision number, or a filename followed by a comma and a branch
  3691.   name (such as
  3692.  
  3693.   foo.c,22a).
  3694.  
  3695.   You can use the -file option to remove the file and all of its revisions
  3696.   from the project.
  3697.  
  3698.   s Warning DeleteRevisions permanently removes the revisions and branches
  3699.   specified. They cannot be recovered.  s
  3700.  
  3701.   You can use the -log option of the ProjectInfo command to see which
  3702.   revisions have been deleted and who deleted them.
  3703.  
  3704.   See Chapter 7 of the MPW Manual for complete definitions of the terms and 
  3705.   symbols used in Projector commands.
  3706.  
  3707.  
  3708.                              Examples
  3709.  
  3710.   DeleteRevisions -project Zoom∫Utilities∫MyProject file.c
  3711.  
  3712.   This example deletes all revisions except the latest in file.c in
  3713.   the named project.
  3714.  
  3715.   DeleteRevisions file.c,22a3
  3716.  
  3717.   This example deletes all revisions on branch 22a before revision
  3718.   3 of file.c.
  3719.  
  3720.   DeleteRevisions file.c,22a
  3721.  
  3722.   This command deletes all the revisions on branch 22a in file.c of
  3723.   the current project.
  3724.  
  3725.   DeleteRevisions -file file.c
  3726.  
  3727.   This command deletes the file file.c and all of its revisions from
  3728.   the current project.
  3729.  
  3730.  
  3731.                              See also 
  3732.  
  3733.   NameRevisions, ProjectInfo.
  3734.  
  3735. æKY DeRez
  3736. æC                     DeRez -- resource decompiler
  3737.  
  3738. DeRez [option…] resourceFile [file…]  > description ≥ progress
  3739.     -c[ompatible]           # generate output compatible with Rez 1.0
  3740.     -e[scape]               # don't escape chars < $20 or > $D8
  3741.     -d[efine] name[=value]  # equivalent to #define name [value]
  3742.     -i[nclude] pathname     # search this path when looking for #include files
  3743.     -m[axstringsize] n      # write strings n characters per line
  3744.     -only typeExpr          # process only resources of this type
  3745.     -p[rogress]             # write progress information to diagnostics
  3746.     -rd                     # suppress warnings for redeclared types
  3747.     -s[kip] typeExpr        # skip resources of this type
  3748.     -u[ndef] name           # equivalent to #undef name
  3749.  
  3750.     Note: A typeExpr may have one of these forms:
  3751.           type
  3752.         "'type'(id)"
  3753.         "'type'(id:id)"
  3754.         "'type'(∂"name∂")"
  3755.  
  3756. Status codes returned:
  3757.   0    No errors.
  3758.   1    Error in parameters.
  3759.   2    Syntax error in file.
  3760.   3    I/O or program error.
  3761.  
  3762.                            Description
  3763.  
  3764.   Creates a text representation (resource description) of the resource
  3765.   fork of resourceFile, according to the resource type declarations
  3766.   in the resource description file(s). The resource description is
  3767.   written to standard output.
  3768.  
  3769.   A resource description file is a file of type declarations in the
  3770.   format used by the resource compiler, Rez. The type declarations
  3771.   for standard Macintosh resources are contained in the files Types.r
  3772.   and SysTypes.r, contained in the {RIncludes} folder. If no resource
  3773.   description file is specified, the output consists of data statements
  3774.   giving the resource data in hexadecimal form, without any additional
  3775.   format information.
  3776.  
  3777.   If the output of DeRez is used as input to Rez, with the same resource
  3778.   description files, it produces the same resource fork that was originally
  3779.   input to DeRez. DeRez is not guaranteed to be able to run a declaration
  3780.   backwards; if it can’t, it produces a data statement instead of the
  3781.   appropriate resource statement.
  3782.  
  3783.   DeRez ignores all include (but not #include), read, data, change,
  3784.   delete, and resource statements found in the resourceDescriptionFile.
  3785.   (It still parses these statements for correct syntax.)
  3786.  
  3787.   For the format of resource type declarations, see Chapter 11 and
  3788.   Appendix D of the MPW manual.
  3789.  
  3790.  
  3791.                              Examples
  3792.  
  3793.   DeRez "{ShellDirectory}MPW Shell" -only MENU Types.r
  3794.  
  3795.   Displays all of the 'MENU' resources used by the MPW Shell. The type
  3796.   definition for 'MENU' resources is found in the file Types.r.
  3797.  
  3798.   DeRez HD:OS:System SysTypes.r ∂
  3799.   -only "'DRVR' (∂"\\0x00Scrapbook∂")"
  3800.  
  3801.   Decompiles the Scrapbook desk accessory in the copy of the System
  3802.   file that’s located in directory HD:OS:. (The type definition for
  3803.   'DRVR' resources is found in the file SysTypes.r.)
  3804.  
  3805.  
  3806.                              See also 
  3807.  
  3808.   Rez and RezDet commands.
  3809.  
  3810.   Chapter 11.
  3811.  
  3812.   Type declaration files in RIncludes folder:
  3813.  
  3814.     • Types.r
  3815.  
  3816.     • SysTypes.r
  3817.  
  3818.     • MPWTypes.r
  3819.  
  3820.     • Pict.r
  3821.  
  3822. æKY Directory
  3823. æC           Directory -- set or write the default directory
  3824.  
  3825. Directory [-q | directory]   > directory
  3826.  -q                      # don't quote directories with special characters
  3827.  
  3828. Status codes returned:
  3829.   0    No error.
  3830.   1    Directory not found, command aborted, or parameter error.
  3831.  
  3832.                            Description
  3833.  
  3834.   If specified, directory becomes the new default directory. Otherwise
  3835.   the pathname of the current default directory is written to standard
  3836.   output.
  3837.  
  3838.   If directory is a leafname, the command searches for directory in
  3839.   the directories listed in the Shell variable {DirectoryPath}. If
  3840.   the variable is undefined, the command looks in the current directory.
  3841.  
  3842.     • Note: To display a directory’s contents, use the Files command.
  3843.  
  3844.  
  3845.                              Examples
  3846.  
  3847.   Directory
  3848.  
  3849.   Writes the pathname of the current directory to standard output.
  3850.  
  3851.   Directory HD:MPW:Examples:
  3852.  
  3853.   Sets the default directory to the folder Examples in the folder MPW
  3854.   on the volume HD. The final colon is optional.
  3855.  
  3856.   Directory Reports:
  3857.  
  3858.   Sets the default directory to the volume Reports. Note that volume
  3859.   names must end in a colon.
  3860.  
  3861.   Directory :Include:Pascal:
  3862.  
  3863.   Sets the default directory to the folder Pascal in the folder Include
  3864.   in the current default directory.
  3865.  
  3866.   Set DirectoryPath ":, {MPW}, {MPW}Projects:"
  3867.  
  3868.   Directory Tools
  3869.  
  3870.   Sets the directory to the Tools directory. The current directory
  3871.   is searched first, followed by the {MPW} directory, and finally by
  3872.   the {MPW} Projects directory. If there is no Tools directory in your
  3873.   current directory, the directory is set to {MPW}Tools.
  3874.  
  3875.  
  3876.                              See also 
  3877.  
  3878.   "File and Window Names" in Chapter 4.
  3879.  
  3880.   Files, NewFolder, and SetDirectory commands.
  3881.  
  3882. æKY DirectoryMenu
  3883. æC        DirectoryMenu [directory…] -- create the Directory menu
  3884.  
  3885. Status code returned:
  3886.    0    no errors always returned.
  3887.  
  3888.                            Description
  3889.  
  3890.   Creates the Directory menu shown here. The optional directory… parameter
  3891.   specifies the initial list of directories that appears in the menu.
  3892.   The menu items are described in Chapter 3 of the MPW manual.
  3893.  
  3894.   The lower section of the Directory menu contains a list of directories.
  3895.   Initially this list consists of the parameters to DirectoryMenu.
  3896.   As other directories become the current directory (using the Set
  3897.   Directory menu item or the SetDirectory command), they are added
  3898.   to the list.
  3899.  
  3900.  
  3901.                              Examples
  3902.  
  3903.   DirectoryMenu `(Files -d -i {MPW}Examples:≈) ≥ Dev:Null` `Directory`
  3904.  
  3905.   Creates the Directory menu. Directories in directory {MPW} that match
  3906.   the pattern Examples:≈ will be included in the Directory menu, along
  3907.   with the current directory.
  3908.  
  3909.   This DirectoryMenu command should be included in your UserStartup
  3910.   file to install the Directory menu. You might replace the Examples
  3911.   directories and the default directory with your favorite list of
  3912.   directories.
  3913.  
  3914. æKY DoIt
  3915. æC       DoIt -- highlight and execute a series of shell commands
  3916.  
  3917. DoIt (CommandFile [-echo] [-dump]) | [-selection]
  3918.  -echo                   # echo commands before execution
  3919.  -dump                   # dump unexecuted commands after error
  3920.  -selection              # execute command in the current selection
  3921.  
  3922. Status codes returned:
  3923.   0    No errors.
  3924.   1    Syntax error.
  3925.  
  3926.                            Description
  3927.  
  3928.   DoIt will execute a series of Shell commands, highlighting each command
  3929.   as it is executed. The commands can be either in a file or in the
  3930.   current selection of the active window. If a CommandFile is passed
  3931.   to DoIt, the file is opened (as the active window) and each command
  3932.   is executed. The window is closed when all commands have been processed.
  3933.  
  3934.   This command will not work for a series of commands that contains
  3935.   structured commands such as If statements or Loops.
  3936.  
  3937.  
  3938.                              Examples
  3939.  
  3940.   Backup -from "HD:Src:" -to "Backup:Src" -a -r -c > out
  3941.  
  3942.   DoIt out
  3943.  
  3944.   The above command will highlight and execute all the Duplicate commands
  3945.   generated by the Backup command. In this way you can see progress
  3946.   as the files are being duplicated.
  3947.  
  3948.   AddMenu DoIt "DoIt Selection" "DoIt -selection"
  3949.  
  3950.   The above AddMenu command will create a menu that can be used to
  3951.   highlight and execute the current selection. This could be used on
  3952.   a series of commands generated by Make or Backup that were written
  3953.   to the Active window. Simply select the commands and select the "DoIt
  3954.   Selection" menu item.
  3955.  
  3956.   Make > make.out
  3957.  
  3958.   DoIt -dump make.out
  3959.  
  3960.   This DoIt command will open the make.out file and highlight and execute
  3961.   each of the commands generated by the previous make command. In this
  3962.   way you can see progress as the files are being compiled and linked.
  3963.   If an error occurs (for instance, in one of the compiles), that compile
  3964.   command along with the rest of the commands in the make.out will
  3965.   be written to the WorkSheet. At this point you could fix the error
  3966.   (in the source file), select the "ToDo" marker (which would select
  3967.   the remaining commands), and select the "DoIt Selection" menu item
  3968.   to execute the remaining commands.
  3969.  
  3970. æKY DumpCode
  3971. æC              DumpCode -- write formatted CODE resources
  3972.  
  3973. DumpCode [option…] resourceFile  > dump ≥ progress
  3974.     -a                      # Show offsets from beginning of segment
  3975.     -d                      # don't dump object code
  3976.     -di                     # don't dump data initialization info
  3977.     -h                      # don't write headers (offsets, hex, etc.)
  3978.     -jt                     # don't dump jump table
  3979.     -n                      # dump only resource names
  3980.     -p                      # write progress information to diagnostics
  3981.     -r byte1[,byte2]        # dump code from address byte1 (through byte2)
  3982.     -ri                     # don't dump a5- and segment-relocation info
  3983.     -rt type[=id]           # dump only resources with this type (and id)
  3984.     -s name                 # dump only resource with this name
  3985.  
  3986. Status codes returned:
  3987.   0    No problem.
  3988.   1    Syntax error.
  3989.   2    Fatal error.
  3990.  
  3991.                            Description
  3992.  
  3993.   Disassembles object code that is stored in resources such as 'CODE',
  3994.   'DRVR', and 'PDEF'. DumpCode reads from the resource fork of the
  3995.   specified file and writes the formatted assembly code to standard
  3996.   output. The default formatting convention is to disassemble the code
  3997.   and to display the corresponding bytes in hexadecimal and ASCII.
  3998.  
  3999.   The default behavior of DumpCode is to dump all the 'CODE' resources
  4000.   from a program file. The -rt option can be used to dump resources
  4001.   of other types, such as drivers and desk accessories.
  4002.  
  4003.   Some conventions about executable code resources are built into DumpCode
  4004.   and affect the formatted output in special ways:
  4005.  
  4006.     • 'CODE' resources with ID 0 are formatted as a jump table (unloaded
  4007.     format).
  4008.  
  4009.     • Other 'CODE' resources have information about jump table entries
  4010.     in the first four bytes.
  4011.  
  4012.     • 'DRVR' resources have a special format at the beginning of
  4013.     the resource.
  4014.  
  4015.   In addition, you can direct DumpCode to give a symbolic dump of data
  4016.   initialization descriptors and initial values.
  4017.  
  4018.  
  4019.                              Examples
  4020.  
  4021.   DumpCode Sample > SampleDump
  4022.  
  4023.   Formats the 'CODE' resources in the file Sample, writing the output
  4024.   to the file SampleDump. The output has this format:
  4025.  
  4026.   File: sample, Resource 3, Type: CODE, Name: _DataInit
  4027.   Offset of first jump table entry: $00000018
  4028.   Segment is $000000D2 bytes long, and uses 1 jump table entry
  4029.   000000: 48E7 FFF0 'H...' MOVEM.L D0-D7/A0-A3,-(A7)
  4030.   000004: 4247 'BG' CLR.W D7
  4031.   000006: 4EAD 0032 'N..2' JSR $0032(A5)
  4032.   00000A: 2218 '".' MOVE.L (A0)+,D1
  4033.   etc.
  4034.  
  4035.  
  4036.                              See also 
  4037.  
  4038.   DumpObj command.
  4039.  
  4040.   "The Jump Table" in the chapter "Segment Loader" of Inside Macintosh,
  4041.   for a description of the jump table.
  4042.  
  4043.   Appendix H, "Object File Format."
  4044.  
  4045. æKY DumpFile
  4046. æC               DumpFile -- display contents of any file
  4047.  
  4048. DumpFile  [ option… ]  filename > dump ≥ progress
  4049.  -rf                # display the resource fork of the file. (Default is 
  4050.                     # data fork.)
  4051.  -bf                # display both forks of the file
  4052.  -a                 # suppress display of ASCII character values. 
  4053.  -h                 # suppress display of hexadecimal characters.
  4054.  -o                 # suppress display of file offsets.
  4055.  -w nn              # width - display nn bytes on each line of output.
  4056.  -g nn              # group nn bytes together without intervening spaces.
  4057.  -p                 # write progress information to diagnostic output.
  4058.  -r byte1[,byteN]   # display only the byte range from byte1 to byteN.
  4059.  
  4060. Status codes returned:
  4061.   0    No problem.
  4062.   1    Syntax error.
  4063.   2    Fatal error.
  4064.  
  4065.                            Description
  4066.  
  4067.   DumpFile lets you display the contents of the resource fork or data
  4068.   fork of a file in a variety of formats.
  4069.  
  4070.  
  4071.                              Examples
  4072.  
  4073.   DumpFile -p ATestFile
  4074.  
  4075.   Formats the data fork of the file ATestFile and writes its contents
  4076.   to standard output. This output has the following format:
  4077.  
  4078.   DumpFile -p ATestFile
  4079.  
  4080.   MPW File Display Utility Version 3.0B1 Release April 15,
  4081.   1988 Start: 1:24:09 PM 4/19/88
  4082.  
  4083.   Copyright Apple Computer, Inc. 1985-1988
  4084.   All Rights Reserved.
  4085.  
  4086.   File : ATestFile
  4087.   Data Fork Length : 20
  4088.   Resource Fork Length : 382
  4089.   Dumping Data Fork from offset 0 to 20
  4090.  
  4091.     0: 54 68 69 73 20 69 73 20 61 20 74 65 73 74 20 66 This.is.a.test.file.
  4092.    10: 69 6C 65 2E
  4093.   DumpFile completed normally
  4094.   Execution required 0 seconds.
  4095.  
  4096.   DumpFile -w 12 -g 4 ATestFile
  4097.  
  4098.   Formats the data fork of the file ATestFile and writes its contents
  4099.   to standard output, grouping four bytes at a time and displaying
  4100.   12 bytes per line. This output has the following format:
  4101.  
  4102.   File : ATestFile
  4103.   Data Fork Length : 20
  4104.   Resource Fork Length : 382
  4105.   Dumping Data Fork from offset 0 to 20
  4106.  
  4107.     0: 54686973 20697320 61207465 This.is.a.te
  4108.     C: 73742066 696C652E st.file.
  4109.  
  4110.   DumpFile -rf -r 0,30 -g 4 ATestFile
  4111.  
  4112.   Formats the resource fork of the file ATestFile and writes the contents
  4113.   of bytes 0 through 30 to standard output in 4-byte groups. This output
  4114.   has the following format:
  4115.  
  4116.   File : ATestFile
  4117.   Data Fork Length : 20
  4118.   Resource Fork Length : 382
  4119.   Dumping Resource Fork from offset 0 to 30
  4120.  
  4121.     0: 00000100 0000014C 0000004C 00000032 .......L...L...2
  4122.    10: 696C652E 6F727920 2227227B 646972 ile.ory."'"{dir
  4123.  
  4124. æKY DumpObj
  4125. æC                DumpObj -- write formatted object file
  4126.  
  4127. DumpObj [option…] objectFile  > dump ≥ progress
  4128.     -d                      # don't dump object code
  4129.     -h                      # don't write headers (offsets, hex, etc.)
  4130.     -i                      # use ids, rather than names, in dump
  4131.     -jn                     # just use names, rather than ids, in dump
  4132.     -l                      # dump file locations of object records
  4133.     -m name                 # dump only module "name" or module containing
  4134.                             # entry-point "name" (-m option may be used repeatedly)
  4135.     -n                      # dump only the dictionary of names
  4136.     -p                      # write progress information to diagnostics
  4137.     -r byte1[,byte2]        # dump code from byte1 in file (through byte2)
  4138.     -mh                     # omit module summary header
  4139.     -mods                   # dump a module summary with entry point information
  4140.     -sym [Off]              # disable symbolic output 
  4141.          [On | Full]        # enable symbolic output (default), can be followed by:
  4142.             [,NoLabels]     #   omit label information
  4143.             [,NoLines]      #   omit source line information
  4144.             [,NoTypes]      #   omit type information
  4145.             [,NoVars]       #   omit variable information
  4146.  
  4147. Status codes returned:
  4148.   0    No problem.
  4149.   1    Syntax error.
  4150.   2    Fatal error.
  4151.  
  4152.                            Description
  4153.  
  4154.   Disassembles object code that is stored in the data fork of an object
  4155.   file. By convention, object files end in the suffix ".o". In addition,
  4156.   the object file must have type 'OBJ'.
  4157.  
  4158.  
  4159.                              Examples
  4160.  
  4161.   DumpObj Sample.p.o >SampleDump
  4162.  
  4163.   Formats the file Sample.p.o and writes its contents to the file SampleDump.
  4164.   This output has the following format:
  4165.  
  4166.   Dump of file sample.p.o
  4167.   First: Kind 0 Version 1
  4168.   Dictionary: FirstId 2
  4169.     2: Main
  4170.  
  4171.   Pad
  4172.   Module: Flags $00 ModuleId 1 SegmentId Main
  4173.   Content: Flags $00
  4174.   Contents offset 0000 size 006A
  4175.  
  4176.   000000: 4E56 FFFE 'NV..' LINK A6,#$FFFE
  4177.   000004: 2F07 '/.' MOVE.L D7,-(A7)
  4178.   000006: 42A7 'B.' CLR.L -(A7)
  4179.   000008: 3F3C 0080 '?<..' MOVE.W #$0080,-(A7)
  4180.   etc.
  4181.  
  4182.   For more information, see Appendix H.
  4183.  
  4184.  
  4185.                              See also 
  4186.  
  4187.   DumpCode command.
  4188.  
  4189.   Appendix H, "Object File Format."
  4190.  
  4191.  
  4192. æKY Duplicate
  4193. æC             Duplicate -- duplicate files and directories
  4194.  
  4195. Duplicate [-y | -n | -c] [-p] [-d | -r] name… target  ≥ progress
  4196.  -y                      # overwrite target files (avoids dialog)
  4197.  -n                      # don't overwrite target files (avoids dialog)
  4198.  -c                      # cancel if conflict occurs (avoids dialog)
  4199.  -p                      # write progress information to diagnostics
  4200.  -d                      # duplicate data fork only
  4201.  -r                      # duplicate resource fork only
  4202.  
  4203. Status codes returned:
  4204.   0    All objects were duplicated.
  4205.   1    Syntax error.
  4206.   2    An error occurred.
  4207.   4    Cancel was selected or implied from the -c option.
  4208.  
  4209.                            Description
  4210.  
  4211.   Duplicates name to targetName. (Name and targetName are file or directory
  4212.   names.) If targetName is a file or doesn’t exist, the file or directory
  4213.   name is duplicated and named targetName. If targetName is a directory,
  4214.   the objects named are duplicated into that directory. (If more than
  4215.   one name is present, targetName must be a directory.) Created objects
  4216.   are given the same creation and modification dates as their source.
  4217.  
  4218.   If a directory is duplicated, its contents (including all subdirectories)
  4219.   are also duplicated. No directory duplicated can be a parent of targetName.
  4220.  
  4221.   Name can also be a volume; if targetName is a directory, name is
  4222.   copied into targetName.
  4223.  
  4224.   A dialog box requests a confirmation if the duplication would overwrite
  4225.   an existing file or folder. You can use the -y, -n, or -c option
  4226.   in scripts to avoid this interaction.
  4227.  
  4228.  
  4229.                              Examples
  4230.  
  4231.   Duplicate Aug86 "Monthly Reports"
  4232.  
  4233.   Assuming "Monthly Reports" is an existing directory, duplicates the
  4234.   file Aug86 into that directory.
  4235.  
  4236.   Duplicate File1 Folder1 "Backup Disk:"
  4237.  
  4238.   Duplicates File1 and Folder1 (including its contents) onto Backup
  4239.   Disk.
  4240.  
  4241.   Duplicate -y File1 File2
  4242.  
  4243.   Duplicates File1 to File2, overwriting File2 if it exists.
  4244.  
  4245.   Duplicate Disk1:≈ HD:Files:
  4246.  
  4247.   Duplicates all of the files on Disk1 into the directory HD:Files.
  4248.  
  4249.   Duplicate Disk1: HD:Files:
  4250.  
  4251.   Duplicates all of Disk1 (as a directory) into HD:Files.
  4252.  
  4253.   Limitation Duplicate doesn’t recognize folders on non-HFS disks.
  4254.  
  4255.  
  4256.                              See also 
  4257.  
  4258.   Move and Rename commands.
  4259.  
  4260.   "File and Window Names" in Chapter 4.
  4261.  
  4262.   "Filename Generation" in Chapter 5.
  4263.  
  4264. æKY Echo
  4265. æC                      Echo -- echo parameters
  4266.  
  4267. Echo [-n] [parameter…]   > parameters
  4268.  -n                      # don't write return following the parameters
  4269.  
  4270. Status codes returned:
  4271.   0    is always returned.
  4272.  
  4273.                            Description
  4274.  
  4275.   Writes its parameters, separated by spaces and terminated by a return,
  4276.   to standard output. If no parameters are specified, only a return
  4277.   is written.
  4278.  
  4279.   Echo is especially useful for checking the results of variable substitution,
  4280.   command substitution, and filename generation.
  4281.  
  4282.  
  4283.                              Examples
  4284.  
  4285.   Echo "Use Echo to write progress info from scripts."
  4286.  
  4287.   Use Echo to write progress info from scripts.
  4288.  
  4289.   The Echo command above writes the second line to standard output.
  4290.  
  4291.   Echo {Status}
  4292.  
  4293.   Writes the current value of the {Status} variable—that is, the status
  4294.   of the last command executed.
  4295.  
  4296.   Echo ≈.a
  4297.  
  4298.   Echoes the names of all files in the current directory that end with
  4299.   ".a". (This might be useful as a precaution before executing another
  4300.   command with the argument "≈.a".)
  4301.  
  4302.   Echo -n > EmptyFile
  4303.  
  4304.   If EmptyFile exists, this command deletes its contents; if the file
  4305.   doesn’t exist, it is created.
  4306.  
  4307.  
  4308.                              See also 
  4309.  
  4310.   Parameters and Quote commands.
  4311.  
  4312. æKY Eject
  4313. æC                       Eject -- eject volumes
  4314.  
  4315. Eject [-m] volume…
  4316.  -m                      # leave the volume mounted
  4317.  
  4318. Status codes returned:
  4319.   0    The disk was successfully ejected.
  4320.   1    Syntax error.
  4321.   2    An error occurred.
  4322.  
  4323.                            Description
  4324.  
  4325.   Flushes the volume, unmounts it, and then ejects it, if it is a 3.5-inch
  4326.   disk. A volume name must end with a colon ( : ). If volume is a number
  4327.   without a colon, it’s interpreted as a drive number.
  4328.  
  4329.     • Note: If you unmount the current volume (the volume containing
  4330.     the current directory), the boot volume becomes the current volume.
  4331.     You can keep the volume mounted with the -m option. (See the
  4332.     chapter "File Manager" of Inside Macintosh.)
  4333.  
  4334.  
  4335.                              Examples
  4336.  
  4337.   Eject Memos:
  4338.  
  4339.   Ejects (and unmounts) the disk titled Memos.
  4340.  
  4341.   Eject 1
  4342.  
  4343.   Ejects and unmounts the disk in drive 1 (the internal drive).
  4344.  
  4345.  
  4346.                              See also 
  4347.  
  4348.   Mount, Unmount, and Volumes commands.
  4349.  
  4350. æKY Entab
  4351. æC                Entab -- convert runs of spaces to tabs
  4352.  
  4353. Entab [option…] [file…]  < file > tabbed ≥ progress
  4354.  -a minValue             # Min run of blanks that can be replaced with a tab
  4355.  -d tabValue             # input tab setting
  4356.  -l quote…               # left quotes that prevent EnTab (default '")
  4357.  -n                      # no quote characters, EnTab everything
  4358.  -p                      # write progress information to diagnostics
  4359.  -q quote…               # quotes that prevent EnTab (default '")
  4360.  -r quote…               # right quotes that prevent EnTab (default '")
  4361.  -t tabValue             # output tab setting
  4362.  
  4363. Status codes returned:
  4364.   0    Normal termination.
  4365.   1    Parameter or option error.
  4366.  
  4367.                            Description
  4368.  
  4369.   Copies the specified text files to standard output, replacing runs
  4370.   of spaces with tabs. The default behavior of Entab is to do the following:
  4371.  
  4372.   1. Detab the input file, using the file’s tab setting (a resource
  4373.   saved with the file by the Shell editor), or 4 if there is none.
  4374.   You can override this "detab" value with the -d option.
  4375.  
  4376.   2. Entab the file, setting tab stops every 4 spaces. You can specify
  4377.   another tab setting with the -t option. The entabbed output file
  4378.   looks the same as the original file(s), but contains fewer characters.
  4379.  
  4380.   Options are also provided for controlling the processing of blanks
  4381.   between quoted strings.
  4382.  
  4383.  
  4384.                              Examples
  4385.  
  4386.   Entab -t 2 Example.p > CleanExample.p
  4387.  
  4388.   Detabs the file Example.p (using the file’s default tab setting),
  4389.   re-entabs it with a tab setting of 2, and writes the resulting output
  4390.   to CleanExample.p.
  4391.  
  4392.   Warning Beware of command formats such as
  4393.  
  4394.   Entab Foo > Foo
  4395.  
  4396.   Limitations Entab does not take into account embedded formatting
  4397.   characters other than tab characters. Thus backspace characters may
  4398.   cause incorrect results.
  4399.  
  4400.   The maximum width for an input line is 255 characters.
  4401.  
  4402.  
  4403.                              See also 
  4404.  
  4405.   Format command.
  4406.  
  4407. æKY Equal
  4408. æC                Equal -- compare files and directories
  4409.  
  4410. Equal [-d | -r] [-i] [-p] [-q] name… target  > differences ≥ progress
  4411.    -d                      # compare data forks only
  4412.    -r                      # compare resource forks only
  4413.    -i                      # ignore files in target not in directory name
  4414.    -p                      # write progress information to diagnostics
  4415.    -q                      # quiet - don't write output, just set {Status}
  4416.  
  4417. Status codes returned:
  4418.   0    Identical files.
  4419.   1    Syntax error.
  4420.   2    Inaccessible or missing parameter.
  4421.   3    Files not equal.
  4422.  
  4423.                            Description
  4424.  
  4425.   Compares name to targetName. By default, Equal makes no comment if
  4426.   files are the same; if they differ, it announces the byte at which
  4427.   the difference occurred. When comparing directories, the default
  4428.   condition is to report all differences, including files not found—the
  4429.   -i option ignores files in targetName that are not present in name.
  4430.  
  4431.   If targetName is a file, every name must also be a file. The specified
  4432.   files are compared with targetName.
  4433.  
  4434.   If targetName is a directory and name is a file, Equal checks in
  4435.   targetName for the file name and compares the two files. That is,
  4436.   the command
  4437.  
  4438.   Equal File1 Dir1
  4439.  
  4440.   compares File1 with :Dir1:File1.
  4441.  
  4442.   If more than one name is specified, Equal compares each name with
  4443.   the corresponding file or directory in targetName. All subdirectories
  4444.   are also compared. For example,
  4445.  
  4446.   Equal File1 Dir1 Dir2
  4447.  
  4448.   If targetName is a directory, name is a directory, and only one name
  4449.   is specified, the Equal command directly compares the two directories.
  4450.   That is, the command
  4451.  
  4452.   Equal Dir1 Dir2
  4453.  
  4454.   compares Dir1 (and all subdirectories) with Dir2.
  4455.  
  4456.  
  4457.                              Examples
  4458.  
  4459.   Equal File1 File1Backup
  4460.  
  4461.   Reports if the files are different and at what point they differ,
  4462.   in a message
  4463.  
  4464.   such as
  4465.  
  4466.   File1 File1Backup differ in data fork, at byte 5
  4467.  
  4468.   Equal -i HD:Dir1 Disk1:Dir1
  4469.  
  4470.   Compares all files and directories in HD:Dir1 with files and directories
  4471.   with the same names found in Disk1:Dir1, and reports any differences.
  4472.   This command does not report files in Disk1:Dir1 that aren’t found
  4473.   in HD:Dir1.
  4474.  
  4475.   Equal -i -d Backup: HD:Source
  4476.  
  4477.   Compares the data forks of all files on the volume Backup: with all
  4478.   those of the same name in the directory HD:Source.
  4479.  
  4480.   Equal -p Old:≈.c HD:Source
  4481.  
  4482.   Compares all files on Old: ending in ".c" with their counterparts
  4483.   in HD:Source. Prints progress information as the comparison proceeds.
  4484.  
  4485.  
  4486.                              See also 
  4487.  
  4488.   Compare command.
  4489.  
  4490. æKY Erase
  4491. æC                     Erase -- initialize volumes
  4492.  
  4493. Erase [-y] [-s] volume…
  4494.  -y                      # yes - erase the disk (avoids dialog)
  4495.  -s                      # single-sided - 400K (default 800K)
  4496.  
  4497. Status codes returned:
  4498.   0    Successful initialization.
  4499.   1    Syntax error.
  4500.   2    No such volume, or boot volume.
  4501.   3    Errors during the initialization procedure.
  4502.  
  4503.                            Description
  4504.  
  4505.   Initializes the specified volumes— the previous contents are destroyed.
  4506.   A volume name must end with a colon ( : ). If volume is a number
  4507.   without a colon, it’s interpreted as a disk drive number.
  4508.  
  4509.   A dialog box requests confirmation before proceeding with the command,
  4510.   unless the -y option is specified. The -y option can be used in scripts
  4511.   to avoid this interaction.
  4512.  
  4513.  
  4514.                              Examples
  4515.  
  4516.   Erase Reports:
  4517.  
  4518.   Initializes the volume entitled Reports.
  4519.  
  4520.   Erase 1
  4521.  
  4522.   Initializes the volume in drive 1 (the internal drive). The disk
  4523.   will be formatted as a 400K disk if drive 1 is a 400K drive, or as
  4524.   an 800K disk if drive 1 is an 800K drive.
  4525.  
  4526. æKY Evaluate
  4527. æC                  Evaluate -- evaluate an expression
  4528.  
  4529. Evaluate [-h | -o | -b] [word…]  > value
  4530. Evaluate Name [binary operator]= expression
  4531.   -h                      # display result in hexadecimal (leading 0x)
  4532.   -o                      # display result in octal (leading 0)
  4533.   -b                      # display result in binary (leading 0b)
  4534.  
  4535. Status codes returned:
  4536.   0    Valid expression.
  4537.   1    Invalid expression.
  4538.  
  4539.                            Description
  4540.  
  4541.   The list of words is taken as an expression. After evaluation, the
  4542.   result is written to standard output. Missing or null parameters
  4543.   are taken as zero. You should quote string operands that contain
  4544.   blanks or any of the characters listed in the table that follows.
  4545.  
  4546.   The operators and precedence are mostly those of the C language;
  4547.   descriptions follow.
  4548.  
  4549.   The second form of the Evaluate command evaluates the list of words
  4550.   and assigns the result to the variable name. The result of the expression
  4551.   is not written to standard output in this case. C style operations
  4552.   of the form "+=", "-=", and so on, are supported. If name is undefined
  4553.   at the time of execution, it is interpreted as zero.
  4554.  
  4555.   Different radices can be used in the input expression, and the result
  4556.   can be output in a different radix by using the -h, -o, or -b option.
  4557.   The default radix is decimal.
  4558.  
  4559.   Expressions: An expression can include any of the following operators.
  4560.   (In some cases, two or three different symbols can be used for the
  4561.   same operation.) The operators are listed in order of precedence;
  4562.   within each group, operators have the same precedence.
  4563.  
  4564.   Operator           Operation
  4565.  
  4566.   1. (expr)          Parentheses are used to group expressions
  4567.  
  4568.   2.  -              Unary negation
  4569.  
  4570.       ~              Bitwise negation
  4571.  
  4572.       !              NOT ¬ Logical NOT
  4573.  
  4574.   3.  *              Multiplication
  4575.  
  4576.       ÷              DIV Division
  4577.  
  4578.      %               MOD Modulus division
  4579.  
  4580.   4. +               Addition
  4581.  
  4582.      -               Subtraction
  4583.  
  4584.   5. <<              Shift left
  4585.  
  4586.      >>              Shift right
  4587.  
  4588.   6. <               Less than
  4589.  
  4590.      <= ≤            Less than or equal to
  4591.  
  4592.      >               Greater than
  4593.  
  4594.      >= ≥            Greater than or equal to
  4595.  
  4596.   7. ==              Equal
  4597.  
  4598.      != <> ≠         Not equal
  4599.  
  4600.      =~              Equal—regular expression
  4601.  
  4602.      !~              Not equal—regular expression
  4603.  
  4604.   8. &               Bitwise AND
  4605.  
  4606.   9. ^               Bitwise XOR
  4607.  
  4608.   10. |              Bitwise OR
  4609.  
  4610.   11. && AND         Logical AND
  4611.  
  4612.   12. || OR          Logical OR
  4613.  
  4614.   All operators group from left to right. Parentheses can be used to
  4615.   override the operator precedence. Null or missing operands are interpreted
  4616.   as zero. The result of an expression is always a string representing
  4617.   a number in the specified radix (the default is decimal).
  4618.  
  4619.   The logical operators !, NOT, ¬, &&, AND, | |, and OR interpret null
  4620.   and zero operands as false, and nonzero operands as true. Relational
  4621.   operators return the value 1 when the relation is true, and the value
  4622.   0 when the relation is false.
  4623.  
  4624.   The string operators ==, !=, =~, and !~ compare their operands as
  4625.   strings. All others operate on numbers. Numbers may be decimal, hexadecimal,
  4626.   octal, or binary integers representable by a 32-bit signed value.
  4627.   Hexadecimal numbers begin with either $ or 0x. Octal numbers begin
  4628.   with a 0 (zero). Binary numbers begin with 0b. Every expression is
  4629.   computed as a 32-bit signed value. Overflows are ignored.
  4630.  
  4631.   Input Radices
  4632.  
  4633.   Decimal number [0–9]
  4634.  
  4635.   Hexadecimal number 0x[0–9A–F]
  4636.  
  4637.   Octal number 0[0–7]
  4638.  
  4639.   Binary number 0b[01]
  4640.  
  4641.   The pattern-matching operators =~ and !~ are like == and != except
  4642.   that the right side is a regular expression that is matched against
  4643.   the left operand. Regular expressions must be enclosed within the
  4644.   regular expression delimiters /…/. Regular expressions are summarized
  4645.   in Appendix B.
  4646.  
  4647.     • Note: There is one difference between using regular expressions
  4648.     after =~ and !~ and using them in editing commands. When evaluating
  4649.     an expression that contains the tagging operator, ®, the Shell
  4650.     creates variables of the form {®n}, containing the matched substrings
  4651.     for each ® operator. (See the examples that follow.)
  4652.  
  4653.   Filename generation, conditional execution, pipe specifications,
  4654.   and input/output specifications are disabled within expressions,
  4655.   to allow the use of many special characters that would otherwise
  4656.   have to be quoted.
  4657.  
  4658.   Expressions are also used in the If, Else, Break, Continue, and Exit
  4659.   commands.
  4660.  
  4661.  
  4662.                              Examples
  4663.  
  4664.   Evaluate (1+2) * (3+4)
  4665.  
  4666.   Does the computation and writes the result to standard output.
  4667.  
  4668.   Evaluate -h 8 + 8
  4669.  
  4670.   Does the computation and writes the result to standard output in
  4671.   hexadecimal (0x10).
  4672.  
  4673.   Evaluate 0xA + 6
  4674.  
  4675.   Writes the result 16 to standard output. (The default output radix
  4676.   is decimal. Use -h for hexadecimal.)
  4677.  
  4678.   Evaluate lines += 1
  4679.  
  4680.   The Evaluate command increments the value of the Shell variable {lines}
  4681.   by 1. If {lines} was undefined before executing the command, {lines}
  4682.   would be 1 after execution.
  4683.  
  4684.   ( Evaluate "{aPathname}" =~ /(([¬:]+:)*)®1≈/ ) > Dev:Null
  4685.  
  4686.   Echo {®1}
  4687.  
  4688.   These commands examine a pathname contained in the variable {aPathname}
  4689.   and return the directory prefix portion of the name. In this case,
  4690.   Evaluate is used for its side effect of enabling regular expression
  4691.   processing of a filename pattern. The right side of the expression
  4692.   ( /(([¬:]+:)*)®1≈/ ) is a regular expression that matches everything
  4693.   in a pathname up to the last colon and remembers it as the Shell
  4694.   variable {®1}. Evaluate’s actual output is not of interest, so it’s
  4695.   redirected to the bit bucket, Dev:Null. (See "Pseudo-Filenames" in
  4696.   Chapter 5.) Note that the use of I/O redirection means that the Evaluate
  4697.   command must be enclosed in parentheses so that the output redirection
  4698.   symbol, >, is not taken as an expression operator.
  4699.  
  4700.   This is a complex but useful example of implementing a "substring"
  4701.   function. For a similar example, see the Rename command.
  4702.  
  4703.  
  4704.                              See also 
  4705.  
  4706.   "Structured Commands" in Chapter 5.
  4707.  
  4708.   "Pattern Matching (Using Regular Expressions)" in Chapter 6, and
  4709.   Appendix B.
  4710.  
  4711. æKY Execute
  4712. æC         Execute -- execute command file in the current scope
  4713.  
  4714. Execute commandFile
  4715.  
  4716. Execute returns the status returned by script.
  4717.  
  4718.                            Description
  4719.  
  4720.   Executes the script as if its contents appeared in place of the Execute
  4721.   command. This means that variable definitions, exports, and aliases
  4722.   in the script will continue to exist after it has finished executing.
  4723.   (Normally these definitions, exports, and aliases would be local
  4724.   to the script.) Any parameters following script are ignored. Any
  4725.   parameters to the enclosing script are available within script.
  4726.  
  4727.     • Note: If script is not a command file (that is, if it’s a built-in
  4728.     command, tool, or application), the command is run as if the
  4729.     word Execute did not appear. Parameters are passed to the command
  4730.     as usual.
  4731.  
  4732.  
  4733.                              Examples
  4734.  
  4735.   Execute {ShellDirectory}Startup
  4736.  
  4737.   Executes the Startup (and UserStartup) scripts. This command is useful
  4738.   for testing any changes you’ve made to the Startup-UserStartup script.
  4739.   Variable definitions, exports, and aliases set in Startup and UserStartup
  4740.   will be available after Startup is done executing.
  4741.  
  4742.  
  4743.                              See also 
  4744.  
  4745.   "Defining and Redefining Variables" in Chapter 5.
  4746.  
  4747.   "The Startup and UserStartup Files" in Chapter 5.
  4748.  
  4749. æKY Exists
  4750. æC        Exists -- confirm the existence of a file or directory
  4751.  
  4752. Exists [-d | -f | -w] [-q] name…  > file
  4753.   -d                      # check if name is a directory
  4754.   -f                      # check if name is a file
  4755.   -w                      # check if name is a file and writeable
  4756.   -q                      # don't quote file names with special characters
  4757.  
  4758. Status codes returned:
  4759.   0    No error.
  4760.   1    Syntax error.
  4761.   2    Other error.
  4762.  
  4763.                            Description
  4764.  
  4765.   Determines the existence of the file or directory name. The options
  4766.   help you to distinguish between directories and files and different
  4767.   access permissions. The nonexistence of name is not considered an
  4768.   error (status remains zero).
  4769.  
  4770.  
  4771.                              Examples
  4772.  
  4773.   If Not "`Exists -d HD:dir`"
  4774.     NewFolder HD:dir
  4775.   End
  4776.   Duplicate ≈.c HD:dir
  4777.  
  4778.   This example creates a new directory and copies all files ending
  4779.   with ".c" in the current directory to this new directory.
  4780.  
  4781.  
  4782.                              See also 
  4783.  
  4784.   Newer command.
  4785.  
  4786. æKY Exit
  4787. æC                   Exit -- exit from a command file
  4788.  
  4789. Exit [status] [If expression]
  4790.  
  4791. If status is present, it is returned as the status value of the 
  4792. script. If the expression is invalid, –5 is returned. Otherwise, the status 
  4793. of the last command executed is returned. 
  4794.  
  4795.                            Description
  4796.  
  4797.   If the expression is nonzero (that is, true), Exit terminates execution
  4798.   of the script in which it appears. When used interactively, Exit
  4799.   terminates execution of previously entered commands. Status is a
  4800.   number; if present, it is returned as the status value of the script.
  4801.   Otherwise, the status of the previous command is returned. If the
  4802.   "If expression" is omitted, the Exit is unconditional. (For a definition
  4803.   of expression, refer to the description of the Evaluate command.)
  4804.  
  4805.  
  4806.                              Examples
  4807.  
  4808.   Exit {ExitStatus}
  4809.  
  4810.   As the last line of a script, this Exit command would return as a
  4811.   status value whatever value had previously been assigned to {ExitStatus}.
  4812.  
  4813.  
  4814.                              See also 
  4815.  
  4816.   Evaluate command (for information on expressions).
  4817.  
  4818.   "Structured Commands" in Chapter 5.
  4819.  
  4820.   {Exit} and {Status} variables, in "Variables," Chapter 5.
  4821.  
  4822. æKY Export
  4823. æC            Export -- make variables available to commands
  4824.  
  4825. Export [-r | -s | name…]  > exports
  4826.  -r                      # generate Unexport commands for all exported variables
  4827.  -s                      # print the names only
  4828.  
  4829. Status codes returned:
  4830.   0    No errors.
  4831.   1    Syntax error.
  4832.  
  4833.                            Description
  4834.  
  4835.   Make the specified variables available to scripts and tools. The
  4836.   list of variables exported within a script is local to that script.
  4837.   An enclosed script or tool inherits a list of exported variables
  4838.   from the enclosing script . (See Figure 5-1 in Chapter 5 of the MPW manual
  4839.   for clarification.)
  4840.  
  4841.     • Note: You can make a variable available to all scripts and
  4842.     tools by setting and exporting it in the Startup or UserStartup
  4843.     files. (Startup acts as the enclosing script for all Shell operations.)
  4844.  
  4845.   If no names are specified, a list of exported variables is written
  4846.   to standard output. (Note that the default output of Export is in
  4847.   the form of Export commands.)
  4848.  
  4849.  
  4850.                              Examples
  4851.  
  4852.   Set AIncludes {MPW}Interfaces:AIncludes:
  4853.  
  4854.   Export AIncludes
  4855.  
  4856.   Defines the variable {AIncludes} as the pathname {MPW}Interfaces:AIncludes:
  4857.   and makes it available to scripts and programs.
  4858.  
  4859.  
  4860.                              See also 
  4861.  
  4862.   Unexport, Set, and Execute commands.
  4863.  
  4864.   "The Startup and UserStartup Files" in Chapter 5.
  4865.  
  4866.   "Exporting Variables" in Chapter 5.
  4867.  
  4868. æKY FileDiv
  4869. æC          FileDiv -- divide a file into several smaller files
  4870.  
  4871. FileDiv [option…] file [prefix]  ≥ progress
  4872.  -b              # input is a byte stream instead of lines
  4873.  -f              # split file at formfeed character
  4874.  -n splitPoint   # split file after splitPoint lines or bytes (-b)
  4875.  -p              # write progress information to diagnostics
  4876.  -s n            # set -b input buffer to n * 512 bytes
  4877.  
  4878. Status codes returned:
  4879.   0    Normal termination.
  4880.   1    Parameter or option error.
  4881.  
  4882.                            Description
  4883.  
  4884.   FileDiv is the inverse of the Catenate command. It is used to break
  4885.   a large file into several smaller pieces. The input file is divided
  4886.   into smaller files, each containing an equal number of lines determined
  4887.   by the splitpoint (default=2000). The last file contains whatever
  4888.   is left over.
  4889.  
  4890.   There is also an option (-f) for splitting a file only when a form
  4891.   feed character
  4892.  
  4893.   (ASCII $0C) occurs as the first character of a line that is beyond
  4894.   the splitpoint. This option lets you split a file at points that
  4895.   are known to be the tops of pages.
  4896.  
  4897.   Each group of splitpoint lines is written to a file with the name
  4898.   prefixNN, where NN is a number starting at 01. If the prefix is omitted,
  4899.   the input file name is used as the prefix.
  4900.  
  4901.  
  4902.                              Examples
  4903.  
  4904.   FileDiv -f -n 2500 Bigfile
  4905.  
  4906.   Splits Bigfile into files of at least 2500 lines; splits the file
  4907.   at points where there are form feed characters. The output files
  4908.   have the names BigfileNN, where NN is 01, 02, and so on.
  4909.  
  4910.   Limitation The maximum length of an input line is 255 characters.
  4911.  
  4912. æKY Files
  4913. æC                  Files -- list files and directories
  4914.  
  4915. Files [option…] [name…]  > fileList
  4916.  -c creator              # list only files with this creator
  4917.  -d                      # list only directories
  4918.  -f                      # list full pathnames
  4919.  -i                      # treat all arguments as files
  4920.  -l                      # long format (type, creator, size, dates, etc.)
  4921.  -m columns              # n column format, where n = columns
  4922.  -n                      # don't print header in long or extended format
  4923.  -o                      # omit directory headers
  4924.  -q                      # don't quote filenames with special characters
  4925.  -r                      # recursively list subdirectories
  4926.  -s                      # suppress the listing of directories
  4927.  -t type                 # list only files of this type
  4928.  -x format               # extended format with the fields specified by format
  4929.  
  4930.  Note: The following characters can specify the format
  4931.      a   Flag attributes
  4932.      b   Logical size, in bytes, of the data fork
  4933.      r   Logical size, in bytes, of the resource fork
  4934.      c   Creator of File ("Fldr" for folders)
  4935.      d   Creation date
  4936.      k   Physical size in kilobytes of both forks
  4937.      m   Modification date
  4938.      t   Type
  4939.      o   Owner (only for folders on a file server)
  4940.      g   Group (only for folders on a file server)
  4941.      p   Privileges (only for folders on a file server)
  4942.  
  4943. Status codes returned:
  4944.   0    All names were processed successfully.
  4945.   1    Syntax error.
  4946.   2    An error occurred.
  4947.  
  4948.                            Description
  4949.  
  4950.   For each disk or directory named, Files lists its contents; for each
  4951.   file named, Files writes its name and any other information requested.
  4952.   Information is written to standard output. When a directory is listed,
  4953.   all subdirectories are listed first in alphabetical order, followed
  4954.   by all files in alphabetical order. If no name is given, the current
  4955.   directory is listed.
  4956.  
  4957.  
  4958.                              Examples
  4959.  
  4960.   files -r -s -f
  4961.  
  4962.   HD:source:defs.h
  4963.   HD:source:main.c
  4964.   HD:source:backup:main.c
  4965.   HD:source:backup:defs.h
  4966.   HD:source:junk:tmpfile
  4967.  
  4968.   Recursively lists the contents of the current directory, giving full
  4969.   pathnames and suppressing the printing of directory names.
  4970.  
  4971.   files -d
  4972.  
  4973.   :backup:
  4974.   :junk:
  4975.  
  4976.   Lists only the directories in the current directory.
  4977.  
  4978.   Files -i -x kd {AIncludes}
  4979.  
  4980.   Name                         Size    Creation-Date
  4981.   --------------------------- ------ ----------------
  4982.   HD:MPW:Interfaces:AIncludes: 365K   8/25/87 5:32 AM
  4983.  
  4984.   Lists the size and creation date of the {AIncludes} directory. Notice
  4985.   how the -i option is used to avoid printing the contents of the directory.
  4986.  
  4987.   files -m 2
  4988.  
  4989.   :backup: deFs.h
  4990.   :junk: main.c
  4991.  
  4992.   This is the two-column format. Notice the order of the files.
  4993.  
  4994. æKY Find
  4995. æC                Find -- find and select a text pattern
  4996.  
  4997. Find [-c count] selection [window]
  4998.  -c count                # find the nth selection, where n = count
  4999.  
  5000. Status codes returned:
  5001.   0    At least one instance of the selection was found.
  5002.   1    Syntax error.
  5003.   2    Any other error.
  5004.  
  5005.                            Description
  5006.  
  5007.   Creates a selection in window. If no window is specified, the target
  5008.   window (the second window from the front) is assumed. It’s an error
  5009.   to specify a window that doesn’t exist.
  5010.  
  5011.   Selection is a selection as defined in Chapter 6 and in Appendix B of the
  5012.   MPW manual.
  5013.  
  5014.     • Note: Searches do not necessarily start at the beginning of
  5015.     a window. A forward search begins at the end of the current selection
  5016.     and continues to the end of the document. A backward search begins
  5017.     at the start of the current selection and continues to the beginning
  5018.     of the document.
  5019.  
  5020.   All searches are not case sensitive by default. You can specify case-sensitive
  5021.   searches by first setting the Shell variable {CaseSensitive} to a
  5022.   nonzero value. (Or, you can automatically set {CaseSensitive} by
  5023.   checking Case Sensitive in the dialog boxes displayed by the Find
  5024.   and Replace menu items.)
  5025.  
  5026.  
  5027.                              Examples
  5028.  
  5029.   Find •
  5030.  
  5031.   Positions the insertion point at the beginning of the target window.
  5032.  
  5033.   Find -c 5 /procedure/ Sample.p
  5034.  
  5035.   Selects the fifth occurrence of "procedure" in the window Sample.p.
  5036.  
  5037.   Find 332
  5038.  
  5039.   Selects line 332 in the target window.
  5040.  
  5041.  
  5042.                              See also 
  5043.  
  5044.   "Selections" and "Pattern Matching" in Chapter 6, and Appendix B.
  5045.  
  5046.   "Find Menu" in Chapter 3.
  5047.  
  5048. æKY Flush
  5049. æC          Flush -- flush the tools that the Shell has cached
  5050.  
  5051. Flush
  5052. \.
  5053. Status codes returned:
  5054.   0    No errors always returned.
  5055.  
  5056.                            Description
  5057.  
  5058.   Flush clears the MPW Shell's tool cache.
  5059.  
  5060.   The MPW Shell keeps the most recently used tools in memory so that
  5061.   execution can be faster. However, there are times when you don’t
  5062.   want the tools to be in the cache. For example, you cannot run a
  5063.   tool, and then switch to the Finder and delete the file. The Finder
  5064.   will report that the tool is busy. You might also want to flush the
  5065.   cache is when you are running benchmarks or timing tool performance.
  5066.  
  5067.  
  5068.                              Examples
  5069.  
  5070.   Flush
  5071.  
  5072.   Flush the current cache. This will free all tools in the cache.
  5073.  
  5074. æKY For
  5075. æC                  For -- repeat commands once per parameter
  5076.  
  5077. For name In word…
  5078.  command…
  5079. End
  5080.  
  5081. Status codes returned:
  5082.   0    The list of words or list of commands was empty.
  5083.   –3   There was an error in the parameters to For.
  5084.  
  5085.                            Description
  5086.  
  5087.   Executes the list of commands once for each word from the "In word…"
  5088.   list. The current word is assigned to variable name, and you can
  5089.   therefore reference it in the list of commands by using the notation
  5090.   {name}. You must end each line with either a return character (as
  5091.   shown above) or with a semicolon (;).
  5092.  
  5093.   The Break command can be used to terminate the loop. The Continue
  5094.   command can be used to terminate the current iteration of the loop.
  5095.  
  5096.   The pipe specification (|), conditional command terminators (&& and
  5097.   ||), and input/output specifications (<, >, >>, ≥, ≥≥, ∑, and ∑∑)
  5098.   may appear following the End; they apply to all of the commands in
  5099.   the list.
  5100.  
  5101.  
  5102.                              Examples
  5103.  
  5104.   For i In 1 2 3
  5105.     Echo i = {i}
  5106.   End
  5107.  
  5108.   Returns the following:
  5109.  
  5110.   i = 1
  5111.   i = 2
  5112.   i = 3
  5113.  
  5114.   For File In ≈.c
  5115.     C {File} ; Echo {File} compiled.
  5116.   End
  5117.  
  5118.   This example compiles every file in the current directory whose name
  5119.   ends with the suffix ".c". The Shell first expands the filename pattern
  5120.   ≈.c, creating a list of the filenames after the "In" word. The enclosed
  5121.   commands are then executed once for each name in the list. Each time
  5122.   the loop is executed, the variable {File} represents the current
  5123.   word in the list. {File} is quoted because a filename could contain
  5124.   spaces or other special characters.
  5125.  
  5126.   For file in Startup UserStartup Suspend Resume Quit
  5127.     Entab {file} > temp
  5128.     Rename -y temp {file}
  5129.     Print -h {file}
  5130.     Echo {file}
  5131.   End
  5132.  
  5133.   This example entabs (replaces multiple spaces with tabs) the five
  5134.   files listed, prints them with headings, and echoes the name of each
  5135.   file after printing is complete. You might want to use this set of
  5136.   commands before making copies of the files to give to a friend. Entabbing
  5137.   the files saves considerable disk space, and printing them gives
  5138.   you some quick documentation to go with the files.
  5139.  
  5140.  
  5141.                              See also 
  5142.  
  5143.   Loop, Break, and Continue commands.
  5144.  
  5145.   "Structured Commands" in Chapter 5.
  5146.  
  5147. æKY Format
  5148. æC        Format -- set or display formatting options for a window
  5149.  
  5150. Format [[-f font] [-s fontsize] [-t tabsize] [-a attr]] | [-x fmt] [window…]
  5151.  -f fontName             # set font to fontName
  5152.  -s fontSize             # set the font size to fontSize
  5153.  -t tabSize              # set the tab size to tabSize
  5154.  -a attr                 # set the auto indent and show invisibles flags
  5155.  -x fmt                  # output the current format in the specified format
  5156.  
  5157.  Note: The following attributes may be used with the -a option:
  5158.      A   auto indentation on
  5159.      a   auto indentation off
  5160.      I   show invisibles on
  5161.      i   show invisibles off
  5162.      L   lock auto scrolling
  5163.      l   unlock auto scrolling
  5164.  
  5165.  Note: The following characters may be used with the -x option:
  5166.      f   font name
  5167.      s   font size
  5168.      t   tab size
  5169.      a   attributes
  5170.  
  5171. Status codes returned:
  5172.   0    No errors.
  5173.   1    Syntax error (error in parameters).
  5174.   2    All other errors.
  5175.  
  5176.                            Description
  5177.  
  5178.   This is a scriptable form of the Format menu command in the Edit
  5179.   menu. Use it to set the format of a specified list of windows. If
  5180.   no window is specified, the command operates on the target window.
  5181.   If no options are specified (other than -x), the current format settings
  5182.   are written to standard output.
  5183.  
  5184.     • Note: The Format command (and the Format menu command) modify
  5185.     the format of an existing window. The format related variables
  5186.     such as {Tab} and {Font} are used to initialize the format of
  5187.     a new window.
  5188.  
  5189.  
  5190.                              Examples
  5191.  
  5192.   Format -f Monaco -t 8 -a A {target}
  5193.  
  5194.   Sets the font, tab size, and auto-indent in the target window. The
  5195.   font size and invisible settings are not changed.
  5196.  
  5197.   Format -s 12 MyWindow
  5198.  
  5199.   Changes the font size in MyWindow to 12 point.
  5200.  
  5201.   Format {Target}
  5202.  
  5203.   A format statement with no options displays the current format of
  5204.   the window, such as the following:
  5205.  
  5206.   Format -f Monaco -s 9 -t 8 -a Ai
  5207.  
  5208.   You can then select and execute this output format.
  5209.  
  5210.   Format -x tsf
  5211.  
  5212.   4 9 Monaco
  5213.  
  5214.   Displays only the values of the specified options. Use this option
  5215.   for easily retrieving one or two values and assigning them to Shell
  5216.   variables for later use.
  5217.  
  5218.  
  5219.                              See also 
  5220.  
  5221.   The "Edit Menu," in Chapter 3.
  5222.  
  5223.   "Variables" in Chapter 5.
  5224.  
  5225. æKY Get
  5226. æC             Get -- get a record from an indexed file
  5227.  
  5228. Get (dataFile… | -dfl listfFle) [-k key] [-width w] [-d default key] [-h | -h2] 
  5229.     [-l] [-m] [-nf] [-q] [-s]  [-x] [-search] [-t] [-sfl] [-y] [-field field list] 
  5230.     [-format format string] ] [-lessFields field list]
  5231.  
  5232.  
  5233.     dataFile                # A specially formatted help file which must be 
  5234.                             # accompanied by an index file whose name is of 
  5235.                             # the form: dataFile.index, and and whose type is 'btre'
  5236.     -dfl listFile           # listFile contains a list of datafiles
  5237.     -k keyword              # keyword in the datafile's index file
  5238.     -width w                # column format for key lists, w = 1..200 is the 
  5239.                             # window width in characters
  5240.     -d default              # use default keyword if no keyword is specified
  5241.     -h                      # write full header
  5242.     -h2                     # write short header (only the used datafile)
  5243.     -l                      # list all keys in the first data file that begin
  5244.                             # with nnn, where nnn is the keyword following -k
  5245.     -lessFields tag [,tag]… # remove the named items from the existing field list 
  5246.                             # (default list or as specified by -field)
  5247.     -m                      # Select the keyword that was found and assign a marker to the selection
  5248.     -nf                     # no filtering; include field tags
  5249.     -q                      # quiet output when keyword not found
  5250.     -s                      # use the selection in the active window as keyword
  5251.     -x                      # create or update the cross reference index file
  5252.     -search                 # text search datafile for occurrences of keyword
  5253.     -t                      # write out template of the requested function/procedure
  5254.     -field tag[,tag]…       # specify the data field(s) to display
  5255.     -format format_string   # specify string(s) to be output in front of data
  5256.                             # specified in -field option.  '%s' flags in string 
  5257.                             # correspond ordinally to tags in -field option
  5258.     -sfl                    # produce ordered list of data files 
  5259.                             # (requires -dfl listFile)
  5260.     -y                      # do not present dialog before (re)building index file
  5261.  
  5262. Status codes returned:  
  5263.   0    The search was successful
  5264.   1    There was a syntax error
  5265.   2    There was an error in processing
  5266.   3    There was a system or out of memory error
  5267.   4    The key was not found.
  5268.  -9    The user aborted the program
  5269.    
  5270.                            Description
  5271.  
  5272.   Get searches the btree file dataFile.index looking for the key word
  5273.   key. If found, Get will return data associated with the key word from 
  5274.   the file dataFile.  The data may be formatted by columns.
  5275.  
  5276. æKY GetErrorText
  5277. æC     GetErrorText -- display error messages based on message number
  5278.  
  5279. GetErrorText [-f filename] [-s filename] [-n] [-p] errnbr[,insert,…] …
  5280. GetErrorText -i idnbr,…
  5281.  # display error messages based on message number
  5282.  
  5283.  -f filename             # explicit error msg file
  5284.  -i idnbr                # report meaning of System Error Handler ID number
  5285.  -n                      # suppress error numbers in displayed messages
  5286.  -p                      # write SysErrs's version info to diagnostics
  5287.  -s filename             # explicit system error msg file (default SysErrs.Err)
  5288.  
  5289. Status codes returned:
  5290.   0    Normal termination.
  5291.   1    Parameter or option error.
  5292.  
  5293.                            Description
  5294.  
  5295.   Displays the error messages corresponding to a set of specified error
  5296.   numbers or ID numbers. By default, GetErrorText assumes that the
  5297.   error numbers correspond to Macintosh Operating System error numbers.
  5298.   The file SysErrs.Err is a special file used by MPW tools to determine
  5299.   the error messages corresponding to system error numbers. Other system
  5300.   error message files may be specified by using the -s option.
  5301.  
  5302.   In addition to system errors, some tools have their own error message
  5303.   files. For example, the assembler's error message file is in the
  5304.   data resource fork of Asm itself. For such tools, you can display
  5305.   the error messages corresponding to tool error numbers by specifying
  5306.   the -f option. In this case, you can specify sample inserts, along
  5307.   with the error numbers, for error messages that take inserts, as
  5308.   shown above.
  5309.  
  5310.   GetErrorText can also display the meanings of the ID numbers reported
  5311.   by the System Error Handler in alert dialog boxes. The -i option
  5312.   is used for this purpose.
  5313.  
  5314.  
  5315.                              Examples
  5316.  
  5317.   GetErrorText -43 -44 -45
  5318.  
  5319.   Displays the error messages corresponding to system errors -43, -44,
  5320.   and -45.
  5321.  
  5322.   GetErrorText -i 28 2
  5323.  
  5324.   Displays the error messages corresponding to system ID numbers 28
  5325.   and 2.
  5326.  
  5327. æKY GetFileName
  5328. æC          GetFileName -- display a Standard File dialog box
  5329.  
  5330. GetFileName [-q] [-s] 
  5331.             [-c | [[-t TYPE]… | -p | -d | -wd] [-m message] [-b buttontitle] [pathname]]
  5332.     -b buttontitle          # specify the default button's title
  5333.     -c                      # write current standard file path to standard output
  5334.     -d                      # select a directory
  5335.     -wd                     # select a directory on a non-locked volume
  5336.     -m message              # specify a prompt
  5337.     -p                      # select a new filename (SFPutFile) 
  5338.     -q                      # suppress quoting of filenames
  5339.     -s                      # return 0 status even if cancel is clicked
  5340.     -t type                 # specify file type for SFGetFile dialog
  5341.  
  5342. Status codes returned:
  5343.   0    User specified a file and no errors occurred.
  5344.   1    Parameter or option error.
  5345.   2    System error.
  5346.   4    User canceled the standard file dialog box.
  5347.  
  5348.                            Description
  5349.  
  5350.   GetFileName displays a standard file dialog box. Either SFPutFile
  5351.   or SFGetFile is called, and the returned filename or pathname is
  5352.   written to standard output. The standard file starting directory
  5353.   is set to pathname if specified. If pathname includes a local filename
  5354.   and if SFPutFile is called, the local filename is used as the default
  5355.   filename. See the examples.
  5356.  
  5357.  
  5358.                              Examples
  5359.  
  5360.   Open `GetFileName -t TEXT {pinterfaces}`
  5361.  
  5362.   Opens the text file in directory {pinterfaces} chosen in SFGetFile
  5363.   by the user.
  5364.  
  5365.   GetFileName -p HD:MPW:StartUp
  5366.  
  5367.   An SFPutFile dialog box is displayed with the directory set to HD:MPW:
  5368.   and StartUp is displayed in the textedit field of the dialog box.
  5369.  
  5370.   Limitation The resulting filename cannot be longer than 255 characters.
  5371.  
  5372.  
  5373.                              See also 
  5374.  
  5375.   "The Standard File Package," Inside Macintosh, Volume I.
  5376.  
  5377. æKY GetListItem
  5378. æC      GetListItem -- display items for selection in a dialog box
  5379.  
  5380. GetListItem [option…] [[item…] | < file]
  5381.     -c[ancel]               # return a status of 0 even when cancel is clicked
  5382.     -d[efault] item         # item is entered in list and comes up selected
  5383.     -m[essage] message      # display message in dialog above the list
  5384.     -q[uote]                # don't quote items in the output
  5385.     -r[ows] rows            # make the list with this many rows
  5386.     -s[ingle]               # only allow a single selection
  5387.     -sort                   # sort input list
  5388.     -w[idth] width          # make the list this many pixels wide
  5389.  
  5390. Status codes returned:
  5391.   0    No errors (or Cancel button was clicked if  -c option is used).
  5392.   1    Syntax error (bad option).
  5393.   2    Cancel button was clicked.
  5394.  
  5395.                            Description
  5396.  
  5397.   Takes the items on the command line (or, if no items are present
  5398.   on the command line, items from standard input) and lists them in
  5399.   a dialog box. Items in the list can be selected with the mouse and
  5400.   modifier keys. Selected items are written to standard output when
  5401.   the OK button is clicked.
  5402.  
  5403.  
  5404.                              Examples
  5405.  
  5406.   Print `files -t TEXT | GetListItem -m "Select files to print:"`
  5407.  
  5408.   Lists all text files in the current directory and prints those selected
  5409.   by the user, as shown below.
  5410.  
  5411. æKY Help.MPW
  5412. æC                  Help -- write summary information
  5413.  
  5414. Help [-f helpfile] [command…]  > helpInformation
  5415.  -f helpfile             # alternate helpfile (default MPW.Help)
  5416.  
  5417. Status codes returned:
  5418.   0    Information was found for the given command.
  5419.   1    Syntax error.
  5420.   2    A command could not be found.
  5421.   3    The help file could not be opened.
  5422.  
  5423. æKY If
  5424. æC                 If -- conditional command execution
  5425.  
  5426. If expression
  5427.  command…
  5428. [Else If expression
  5429.  command… ] …
  5430. [Else
  5431.  command… ]
  5432. End
  5433.  
  5434. Status codes returned:
  5435.    0    None of the lists of commands were executed.
  5436.   –1    Invalid expression.
  5437.  
  5438.                            Description
  5439.  
  5440.   Executes the list of commands following the first expression whose
  5441.   value is nonzero. (Null strings are considered zero.) At most one
  5442.   list of commands is executed. You may specify any number of "Else
  5443.   If" clauses. The final Else clause is optional. The return characters
  5444.   (as shown above) or semicolons must appear at the end of each line.
  5445.  
  5446.   The pipe specification (|), conditional command terminators (&& and
  5447.   ||), and input/output specifications (<, >, >>, ≥, ≥≥, ∑, ∑∑) may
  5448.   appear following the End and apply to all of the commands in the
  5449.   list.
  5450.  
  5451.   For a definition of expression, see the description of the Evaluate
  5452.   command.
  5453.  
  5454.  
  5455.                              Examples
  5456.  
  5457.   If {Status} == 0
  5458.     Beep 1a,25,200
  5459.   Else
  5460.     Beep -3a,25,200
  5461.   End
  5462.  
  5463.   Produces an audible indication of the success or failure of the preceding
  5464.   command.
  5465.  
  5466.   For window in `Windows`
  5467.     If {window} != {Worksheet} AND {window} != {Active}
  5468.       Close {window}
  5469.     End
  5470.   End
  5471.  
  5472.   Closes all of the open windows except the active window and the Worksheet
  5473.   window. (Refer also to the Windows command.)
  5474.  
  5475.   The following commands, as a script, would implement a trivial case
  5476.   of a general "compile" command:
  5477.  
  5478.   If {1} =~ /≈.c/
  5479.     C {COptions} {1}
  5480.   Else If {1} =~ /≈.p/
  5481.     Pascal {POptions} {1}
  5482.   End
  5483.  
  5484.   If the above commands were saved in a file (say, as "Compile"), both
  5485.   C and Pascal programs could be compiled with the command
  5486.  
  5487.   Compile filename
  5488.  
  5489.  
  5490.                              See also 
  5491.  
  5492.   Evaluate command (for a description of expressions).
  5493.  
  5494.   "Structured Commands" in Chapter 5.
  5495.  
  5496. æKY Lib
  5497. æC           Lib -- combine object files into a library file
  5498.  
  5499. Lib [option…] objectFile…  ≥ progress
  5500.     -d                      # suppress duplicate definition warnings
  5501.     -df deleteFile          # delete modules listed in file deleteFile
  5502.     -dm name[,name]…        # delete external modules and entry points
  5503.     -dn name[,name]…        # delete external names, making them local
  5504.     -f                      # allow FORTRAN-style common data
  5505.     -mf                     # use MultiFinder temporary memory if necessary
  5506.     -o name                 # write object file name (default Lib.Out.o)
  5507.     -p                      # write progress information to diagnostics
  5508.     -rn OldNameA=NewNameA   # change module name(s) OldNameA to NewNameA,
  5509.       [,OldNameB=NewNameB]… #   OldNameB to NewNameB, etc.
  5510.     -sg newSeg=old[,old]…   # merge old segments into new segment
  5511.     -sn oldSeg=newSeg       # change segment name oldSeg to newSeg
  5512.     -sym [On | Full]        # keep symbolic information (default)
  5513.          [Off]              # discard symbolic information, can be followed by:
  5514.             [,NoLabels]     # discard label information
  5515.             [,NoLines]      # discard source line information
  5516.             [,NoTypes]      # discard type information
  5517.             [,NoVars]       # discard variable information
  5518.     -ver N                  # set OMF file version number to N
  5519.     -w                      # suppress warnings
  5520.  
  5521. Status codes returned:
  5522.   0    No problem.
  5523.   1    Syntax error.
  5524.   2    Fatal error.
  5525.  
  5526.                            Description
  5527.  
  5528.   Combines the specified object files into a single file. Input files
  5529.   must have type 'OBJ' .
  5530.  
  5531.   Lib is used for the following:
  5532.  
  5533.     • Combining object code from different languages into a single
  5534.     file.
  5535.  
  5536.     • Combining several object files into a larger object file (a
  5537.     library).
  5538.  
  5539.     • Combining several libraries into a single library, for use
  5540.     in building a particular application or desk accessory. This
  5541.     can greatly improve the performance of the Linker.
  5542.  
  5543.     • Deleting unneeded modules (with the -dm option), changing segmentation
  5544.     (the -sg and -sn options), or changing the scope of a symbol
  5545.     from external to local (the -dn option). (These options are useful
  5546.     when you construct a specialized library for linking a particular
  5547.     program.)
  5548.  
  5549.   Object files that have been processed with Lib result in significantly
  5550.   faster links when compared with the "raw" object files produced by
  5551.   the assembler or compilers.
  5552.  
  5553.   The output of Lib is logically equivalent to the concatenation of
  5554.   the input files, except for the optional renaming, resegmentation,
  5555.   and deletion operations, and the possibility of overriding an external
  5556.   name. The resolution of external names in Lib is identical to Link—in
  5557.   fact, the two programs share the same code for reading object files.
  5558.   Although multiple symbols are reduced to a single symbol, no combining
  5559.   of modules into larger modules is performed, and no cross-module
  5560.   references are resolved. This behavior guarantees that the Linker’s
  5561.   output will be the same size whether or not the output of Lib was
  5562.   used.
  5563.  
  5564.   See "Library Construction" in Chapter 10 of the MPW manual for a detailed 
  5565.   discussion of the behavior and use of Lib.
  5566.  
  5567.  
  5568.                              Examples
  5569.  
  5570.   Lib {CLibraries}≈ -o {CLibraries}CLibrary.o
  5571.  
  5572.   Combines all of the library object files from the {CLibraries} directory
  5573.   into a single library named CLibrary.o. For applications that require
  5574.   most or all of the C library files, using the new CLibrary file will
  5575.   reduce link time.
  5576.  
  5577.  
  5578.                              See also 
  5579.  
  5580.   Link, DumpObj, and DumpCode commands.
  5581.  
  5582.   "Optimizing Your Links" and "Library Construction" in Chapter 10.
  5583.  
  5584.   Appendix H.
  5585.  
  5586. æKY Line
  5587. æC                Line -- find line in the target window
  5588.  
  5589. Line n
  5590.  
  5591. Status codes can be returned by either the Find or the Open commands 
  5592. that make up the Line script:
  5593.   0    No errors.
  5594.   1    Syntax error.
  5595.   2    No target window; other error.
  5596.   3    System error.
  5597.  
  5598.                            Description
  5599.  
  5600.   Line finds line n in the target window. The parameter n is usually
  5601.   an integer, but may be any selection expression. The target window
  5602.   becomes the active (frontmost) window.
  5603.  
  5604.   Line is a script containing these two commands:
  5605.  
  5606.   Find {1} {target} # Find line n in the target window
  5607.  
  5608.   Open {target} # Bring the target window to the top
  5609.  
  5610.  
  5611.                              Examples
  5612.  
  5613.   Line 123
  5614.  
  5615.   Finds line 123 in the target window and makes the target window the
  5616.   new active window.
  5617.  
  5618.   ### Undefined symbol: length
  5619.  
  5620.   File Count.c; Line 75
  5621.  
  5622.   The File and Line commands above are part of an error message produced
  5623.   by the MPW C compiler. The MPW Assembler and MPW Pascal compilers
  5624.   produce errors when using similar formats. You can execute such error
  5625.   messages to find the line that contains the error.
  5626.  
  5627.   The command File is defined as an alias for Target in the Startup
  5628.   file. Thus File opens the specified file as the target window. Line
  5629.   then selects the offending line in the window and brings the window
  5630.   to the front. Notice that the remainder of the error message is a
  5631.   comment.
  5632.  
  5633.  
  5634.                              See also 
  5635.  
  5636.   Find command.
  5637.  
  5638. æKY Link
  5639. æC           Link -- link an application, tool, or resource
  5640.  
  5641. Link [option…] objectFile…  > map ≥ progress
  5642.  -ac alignment           # align code modules to 'n' byte boundaries
  5643.  -ad alignment           # align data modules to 'n' byte boundaries
  5644.  -c creator              # set resourceFile creator (default ????)
  5645.  -d                      # suppress duplicate definition warnings
  5646.  -da                     # desk accessory - add NULL to segment names
  5647.  -f                      # allow FORTRAN-style common data
  5648.  -l                      # write a location map to output
  5649.  -la                     # -l, include anonymous symbols in location map
  5650.  -lf                     # -l, include file and location of definitions
  5651.  -m mainEntry            # use mainEntry as main entry point
  5652.  -ma name=alias          # create an alias for module name
  5653.  -map                    # generate "friendly" link map
  5654.  -mf                     # use MultiFinder temporary memory if necessary
  5655.  -model far              # process 32-bit load-time relocatable references
  5656.  -model near             # prohibit 32-bit load-time relocatable references
  5657.  -msg keyword[,…]        # message options
  5658.      [no]dup             #   (suppress) warnings about duplicate symbols
  5659.      [no]multiple        #   (suppress) multiple undefined symbol reports
  5660.      [no]warn            #   (suppress) warning messages
  5661.  -o resourceFile         # write resourceFile (default Link.Out)
  5662.  -opt [Off]              # disable Object Pascal optimizations (default)
  5663.       [On ]              # enable optimizations
  5664.       [NoBypass]         # enable optimizations, but always dispatch
  5665.          [,Info]         #   write optimization information to diagnostics
  5666.          [,Names]        #   include MacsBug symbols within SelectorProc modules
  5667.  -p                      # write progress information to diagnostics
  5668.  -pg size                # set page size to "size"; max:32K; min: 1024; default: 2048
  5669.  -ra [seg]=attr[,attr…]  # set segment resource attributes:
  5670.      $xx (or) nnn        #   a hex or decimal attribute you figure out
  5671.      resSysHeap          #   or a comma-seperated list of resource
  5672.      resPurgeable        #    attributes by name
  5673.      resLocked           #   
  5674.      resProtected        #   
  5675.      resPreload          #   
  5676.      resChanged          #   (essentially ignored)
  5677.  -rn                     # don't include resource names in resourceFile
  5678.  -rt type[=id]           # set resource type and lowest id (default CODE=0)  
  5679.  -sg newSeg[=old[,old]…] # merge old segments into new segment
  5680.  -sn oldSeg=newSeg       # change segment name oldSeg to newSeg
  5681.  -srt                    # sort global data by "near" and "far" references
  5682.  -ss size                # maximum segment size (default 32760)
  5683.  -sym [Off]              # disable symbolic output (default)
  5684.          [On | Full]     # enable symbolic output, can be followed by:
  5685.          [,NoLabels]     #   omit label information
  5686.          [,NoLines]      #   omit source line information
  5687.          [,NoTypes]      #   omit type information
  5688.          [,NoVars]       #   omit variable information
  5689.  -t type                 # set resourceFile type (default APPL)
  5690.  -uf unrefFile           # write list of unreferenced modules to unrefFile
  5691.  -w                      # suppress warnings
  5692.  -wrap                   # when jump table space is exhausted, put excess jump table 
  5693.                          #   entries in global data space, if available
  5694.  -x crossRefFile         # write cross reference to crossRefFile
  5695.  
  5696. Status codes returned:
  5697.   0    No problem.
  5698.   1    Syntax error.
  5699.   2    Fatal error.
  5700.  
  5701.                            Description
  5702.  
  5703.   Links the specified object files into an application, tool, desk
  5704.   accessory, or driver. The input object files must have type 'OBJ'.
  5705.   Linked segments from the input object files are placed in code resources
  5706.   in the resource fork of the output file. The default output filename
  5707.   is Link.Out, but you can specify other names with the -o option.
  5708.  
  5709.   For detailed information about the linker, and instructions for linking
  5710.   applications, MPW tools, and desk accessories, see Chapters 8 and
  5711.   10 of the MPW manual. The first dialog box of Link’s Commando dialog is 
  5712.   reprinted here for convenience.
  5713.  
  5714.   The linker’s default action is to link an application, placing the
  5715.   output segments into 'CODE' resources. When you link an application,
  5716.   all old 'CODE' resources are deleted before the new 'CODE' resources
  5717.   are written. By default, resources created by the linker are given
  5718.   resource names that are the same as the corresponding segment names.
  5719.   You can change a resource (segment) name with the -sn or -sg options,
  5720.   and you can create unnamed resources with the -rn option.
  5721.  
  5722.   The linker executes in four phases:
  5723.  
  5724.     • Input phase: The linker reads all input files, finds all symbolic
  5725.     references and their corresponding definitions, and constructs
  5726.     a reference graph. Duplicate references are found and warnings
  5727.     are issued.
  5728.  
  5729.     • Analysis phase: The linker allocates and relocates code and
  5730.     data, detects missing references, and builds the jump table.
  5731.     If the -l or -x option is given, Link produces a linker map or
  5732.     cross-reference listing. The linker also eliminates unused code
  5733.     and data.
  5734.  
  5735.     • Output phase: The linker copies linked code segments into code
  5736.     resources in the resource fork of the output file. By default,
  5737.     these resources are given the same names as the corresponding
  5738.     segment names. (The cursor spins backward during this phase.)
  5739.  
  5740.     • Symbolic output phase: Optionally, Link may be used to create
  5741.     the .SYM file for use with SADE.
  5742.  
  5743.  
  5744.                              Examples
  5745.  
  5746.   Link Sample.p.o ∂
  5747.   "{PLibraries}"PInterface.o ∂
  5748.   "{PLibraries}"PasLib.o ∂
  5749.   "{Libraries}"Runtime.o ∂
  5750.   -o Sample ∂
  5751.   -la >Sample.map
  5752.  
  5753.   Links the main program file Sample.p.o with the libraries PInterface.o,
  5754.   PasLib.o, and Runtime.o, placing the output in Sample and placing
  5755.   the Linker map in the file Sample.map. Sample is an application that
  5756.   can be launched from the Finder or executed from MPW.
  5757.  
  5758.   Link -rt MROM=8 -c 'MPS ' -t ZROM -ss 140000 ∂
  5759.   -l > ROMLocListing -o MyROMImage {LinkList}
  5760.  
  5761.   Links the files defined in the Shell variable {LinkList} into a ROM
  5762.   image file, placing the output in the file MyROMImage. The segment
  5763.   size is set to 140,000 bytes, and the ROM is created as a resource
  5764.   'MROM' with ID=8. The file is typed as being created by MPW (creator
  5765.   'MPS '), with file type ZROM. Link’s location-ordered listing is
  5766.   placed in the file ROMLocListing.
  5767.  
  5768.   For additional examples, see "Link" in Chapter 10 and the makefiles
  5769.   in the Examples folders for the languages you are using.
  5770.  
  5771.  
  5772.                              See also 
  5773.  
  5774.   Lib command and Appendix H, "Object File Format."
  5775.  
  5776.   Chapter 8, "The Build Process," and Chapter 10, "Link."
  5777.  
  5778.   The Segment Loader and the Resource Manager chapters in Inside Macintosh.
  5779.  
  5780.   Inside Macintosh, Volume IV, for information on the 128K ROM, the
  5781.   System Folder, and the Finder.
  5782.  
  5783. æKY Loop
  5784. æC                 Loop -- repeat commands until Break
  5785.  
  5786. Loop
  5787.  command…
  5788. End
  5789.  
  5790. Loop returns the status of the last command executed.
  5791.  
  5792.                            Description
  5793.  
  5794.   Executes the enclosed commands repeatedly. The Break command is used
  5795.   to terminate the loop. The Continue command can be used to terminate
  5796.   the current iteration of the loop.
  5797.  
  5798.   The pipe specification (|), conditional command terminators (&& and
  5799.   ||), and input/output specifications (<, >, >>, ≥, ≥≥, ∑, and ∑∑)
  5800.   may appear following the End, and apply to all of the commands in
  5801.   the list.
  5802.  
  5803.  
  5804.                              Examples
  5805.  
  5806.   The following script runs a command several times, once for each
  5807.   parameter:
  5808.  
  5809.   ### Repeat - Repeat a command for several parameters ###
  5810.  
  5811.   # Syntax:
  5812.  
  5813.   # Repeat command parameter…
  5814.  
  5815.   #
  5816.  
  5817.   # Execute command once for each parameter in the parameter
  5818.  
  5819.   # list. Options can be specified by including them with
  5820.  
  5821.   # the command name in quotes.
  5822.  
  5823.   #
  5824.  
  5825.   Set cmd {1}
  5826.  
  5827.   Loop
  5828.  
  5829.   Shift
  5830.  
  5831.   Break If {1} ==
  5832.  
  5833.   {cmd} {1}
  5834.  
  5835.   End
  5836.  
  5837.   Notice that Shift is used to step through the parameters, and that
  5838.   Break ends the loop when all parameters have been used.
  5839.  
  5840.  
  5841.                              See also 
  5842.  
  5843.   Break, For, and Continue commands.
  5844.  
  5845.   "Structured Commands" in Chapter 5.
  5846.  
  5847. æKY Make
  5848. æC             Make -- build up-to-date version of a program
  5849.  
  5850. Make [option…] target…   > commands ≥ progress
  5851.  -d name[=value]         # define variable name as value (overrides makefile)
  5852.  -e                      # rebuild everything regardless of dates
  5853.  -f makefile             # read dependencies from makefile (default MakeFile)
  5854.  -p                      # write progress information to diagnostics
  5855.  -r                      # write roots of dependency graph to output
  5856.  -s                      # write structure of target dependencies to output
  5857.  -t                      # touch dates of targets and prerequisites
  5858.  -u                      # identify targets in makefile not reached in build
  5859.  -v                      # write verbose explanations to diagnostics
  5860.  -w                      # suppress warnings
  5861.  -y                      # like -v, but omit announcing up-to-date targets
  5862.  
  5863.  
  5864. Status codes returned:
  5865.   0    Successful completion.
  5866.   1    Parameter or option error.
  5867.   2    Execution error.
  5868.  
  5869.                            Description
  5870.  
  5871.   Generates a set of Shell commands that you can execute to build up-to-date
  5872.   versions of the specified target files. (If no target is specified,
  5873.   the target on the left side of the first dependency rule in the makefile
  5874.   is built.) Make allows you to rebuild only those components of a
  5875.   program that require rebuilding. Make determines which components
  5876.   need rebuilding by reading a makefile. This is a text file that describes
  5877.   dependencies between the components of a program, along with the
  5878.   Shell commands needed to rebuild each component. You can specify
  5879.   makefiles with the -f option. After processing the makefiles, Make
  5880.   writes to standard output the appropriate set(s) of commands needed
  5881.   to rebuild the target(s).
  5882.  
  5883.   See "Format of a Makefile" in Chapter 9 of the MPW manual for a 
  5884.   description of the format of a makefile. The first dialog box of Make’s 
  5885.   Commando dialog is reproduced here for convenience.
  5886.  
  5887.   Make executes in two phases:
  5888.  
  5889.     • In the first phase, Make reads the makefile(s) and creates
  5890.     a file (target) dependency graph. (The "beachball" cursor spins
  5891.     counterclockwise during this phase.)
  5892.  
  5893.     • In the second phase, Make generates the build commands for
  5894.     the target to be built (the cursor spins clockwise). If a target
  5895.     file doesn’t exist or if it depends on files that are out-of-date
  5896.     or newer than the target, Make writes out the appropriate command
  5897.     lines for updating the target file. This process is recursive
  5898.     and "bottom up" so that commands are issued first for those lower-level
  5899.     dependencies that need to be rebuilt.
  5900.  
  5901.   You can execute the generated build commands after Make is done executing.
  5902.  
  5903.  
  5904.                              Examples
  5905.  
  5906.   Make -p -f MakeFile Sample
  5907.  
  5908.   Makes the target file Sample, and prints progress information. Sample’s
  5909.   dependency relations are described in the makefile :AExamples:MakeFile.
  5910.  
  5911.   Sample ƒƒ Sample.r
  5912.       Rez Sample.r -o Sample -a
  5913.       SetFile -a B Sample -c ASMP -t APPL #set bundle bit
  5914.  
  5915.   Sample ƒƒ Sample.r Sample.a.o
  5916.       Link Sample.a.o -o Sample
  5917.  
  5918.   Sample.a.o ƒ Sample.a
  5919.       Asm Sample.a
  5920.  
  5921.   The ƒ (Option-F) character means "is a function of"—that is, the
  5922.   file on the left side depends on the files on the right side. If
  5923.   the files on the right are newer, the subsequent Shell commands are
  5924.   written to standard output. (See Chapter 9 for details.)
  5925.  
  5926.  
  5927.                              See also 
  5928.  
  5929.   "Format of a Makefile" in Chapter 9 for the format of a makefile,
  5930.   examples, and other information about using Make.
  5931.  
  5932.   Makefiles for building sample programs are contained in the Examples
  5933.   folders:
  5934.  
  5935.     • Examples:AExamples:Makefile
  5936.  
  5937.     • Examples:PExamples:Makefile
  5938.  
  5939.     • Examples:CExamples:Makefile
  5940.  
  5941.  
  5942. æKY MakeErrorFile
  5943. æC            MakeErrorFile -- create error message textfile
  5944.  
  5945. MakeErrorFile [option…] [file…]  < file > listing ≥ progress
  5946.  -l                      # write listing to standard output
  5947.  -o file/dir             # output file or directory
  5948.  -p                      # write progress information to diagnostics
  5949.  
  5950. Status codes returned:
  5951.   0    No errors.
  5952.   1    Syntax error.
  5953.   2    Error in processing.
  5954.  
  5955.                            Description
  5956.  
  5957.   MakeErrorFile creates specially formatted error message files used
  5958.   to retrieve the error messages associated with error numbers. The
  5959.   ErrMgr unit in the ToolLibs.o library is used by programs to access
  5960.   the error files created by MakeErrorFile. SysErrs.Err is one such
  5961.   error file; it is used by various MPW tools to get the textual messages
  5962.   associated with Macintosh system error codes. See the documentation
  5963.   on the ErrMgr unit for more information on how error files are accessed.
  5964.  
  5965.  
  5966.                              Examples
  5967.  
  5968.   MakeErrorFile SysErrs -l >SysErrsList
  5969.  
  5970.   Writes an ordered list of system error numbers and messages to the
  5971.   file SysErrsList.
  5972.  
  5973.  
  5974. æKY Mark
  5975. æC                Mark -- assign a marker to a selection
  5976.  
  5977. Mark [-y | -n] selection name [window]
  5978.  -y                      # replace existing marker (avoids dialog)
  5979.  -n                      # don't replace existing marker (avoids dialog)
  5980.  
  5981. Status codes returned:
  5982.   0    No errors.
  5983.   1    Syntax error.
  5984.   2    Error in processing.
  5985.   3    System error.
  5986.  
  5987.                            Description
  5988.  
  5989.   Mark assigns the marker name to the range of text specified by the
  5990.   selection in window. If no window is specified, the command operates
  5991.   on the target window (the second window from the front). The new
  5992.   marker name is included in the Mark menu when window is the current
  5993.   active window. A marker is associated with a logical, as opposed
  5994.   to absolute, range of text. The ranges of markers may overlap, but
  5995.   each marker must have a unique name. Marker names are case sensitive.
  5996.  
  5997.   A dialog box requests confirmation if the marker name conflicts with
  5998.   an existing marker name. The -y or -n option can be used in scripts
  5999.   to avoid this interaction.
  6000.  
  6001.   Deletion and insertion operations affect markers according to these
  6002.   rules:
  6003.  
  6004.     • Any editing outside the range of a marker will not affect the
  6005.     logical range of the marker, where "outside" means that the range
  6006.     of editing changes does not intersect the range of the marker.
  6007.  
  6008.     • Any editing inside the range of a marker will change the logical
  6009.     range of the marker by the amount of the editing change. For
  6010.     example, adding ten characters to the inside of a marker’s range
  6011.     will increase the range of the marker by ten characters. Another
  6012.     way to say this is that a marker has responsibility for all the
  6013.     characters added to (or deleted from) its range.
  6014.  
  6015.     • Any deletion that totally encloses a marker will delete the
  6016.     marker.
  6017.  
  6018.  
  6019.                              Examples
  6020.  
  6021.   Mark § 'Procedure 1'
  6022.  
  6023.   Assigns a marker with the name "Procedure 1" to the current selection
  6024.   in the target window.
  6025.  
  6026.   Limitation It is currently not possible to "Undo" the effects of
  6027.   any editing operations on markers.
  6028.  
  6029.  
  6030.                              See also 
  6031.  
  6032.   Unmark and Markers commands.
  6033.  
  6034.   "Mark Menu" in Chapter 3.
  6035.  
  6036.   "Markers" in Chapter 6.
  6037.  
  6038. æKY Markers
  6039. æC                        Markers -- list markers
  6040.  
  6041. Markers [-q] [window]
  6042.  -q                      # don't quote the marker names
  6043.  
  6044. Status codes returned:
  6045.   0    No errors.
  6046.   1    Syntax error.
  6047.   2    Error in processing.
  6048.   3    System error.
  6049.  
  6050.                            Description
  6051.  
  6052.   Markers prints the names of all markers associated with window. The
  6053.   names are written one per line, and they are ordered from the beginning
  6054.   to the end of the window.
  6055.  
  6056.  
  6057.                              Examples
  6058.  
  6059.   Markers {Target}
  6060.  
  6061.   Lists all markers associated with the target window.
  6062.  
  6063.  
  6064.                              See also 
  6065.  
  6066.   "Mark Menu" in Chapter 3.
  6067.  
  6068.   "Markers" in Chapter 6.
  6069.  
  6070. æKY MatchIt
  6071. æC   MatchIt -- semi-intelligent language sensitive bracket matcher
  6072.  
  6073. MatchIt [-a[sm] | -p[ascal] | -c] [-h] [-l] [-n] [-v] [window]
  6074.  -a[sm]                  # target language is Assembler
  6075.  -p[ascal]               # target language is Pascal
  6076.  -c                      # target language is C
  6077.  -h                      # highlight all characters enclosed by match
  6078.  -l                      # highlight entire lines containing match
  6079.  -n                      # generate error message if no match
  6080.  -v                      # display MatchIt's version number
  6081.  
  6082. Status codes returned:
  6083.   0    Normal termination.
  6084.   1    Parameter or option error.
  6085.   3    Matching delimiter not found (only if -n option specified).
  6086.  
  6087.                            Description
  6088.  
  6089.   Matches C, Pascal, and assembly-language delimiters with their mates
  6090.   in the specified window. The default window is the target window
  6091.   (second from front). The characters highlighted as the current selection1
  6092.   in the window are used as the left delimiter. MatchIt attempts to
  6093.   find the corresponding right mate for the selected delimiter.
  6094.  
  6095.   MatchIt is syntax sensitive, so that it is semi-intelligent about
  6096.   how it finds the matching delimiter. For example, if a Pascal BEGIN
  6097.   is the specified selection, MatchIt finds the proper END that matches
  6098.   it. All commenting conventions, strings, nesting, and so on are taken
  6099.   into account when searching for the end delimiter.
  6100.  
  6101.   The functionality of MatchIt is similar to the Shell editor’s ability
  6102.   to find mates for the characters ( [ { and '' when you double-click
  6103.   any of these characters. However, MatchIt differs from the Shell
  6104.   editor by supporting even more delimiters and using the knowledge
  6105.   of the target language syntax to find the proper match. The following
  6106.   table summarizes all the delimiters supported and for which languages:
  6107.  
  6108.  
  6109.                              Examples
  6110.  
  6111.   matchit  mysource.p
  6112.  
  6113.   For the current selected delimiter in the open window mysource.p,
  6114.   find the delimiter's mate. The language is assumed to be Pascal (because
  6115.   of the .p suffix.). No message is reported and the selection is not
  6116.   changed if the mate cannot be found. Of course, errors are still
  6117.   reported to diagnostic output if the input selection is not a valid
  6118.   Pascal delimiter (according to the table in "Options"). If MatchIt
  6119.   is to be used explicitly, a more general form for its use is shown
  6120.   in this example:
  6121.  
  6122.   matchit  -n  "{target}"
  6123.  
  6124.   For the current selected delimiter in the open target window, find
  6125.   the delimiter’s mate. The "{target}" specification could have been
  6126.   omitted, as it is MatchIt’s default. If explicitly specified, as
  6127.   shown here, it is best to quote it. The language is determined by
  6128.   the window’s name suffix (if present), or by the the selection, if
  6129.   the suffix is not acceptable to MatchIt. An error is reported if
  6130.   the mate cannot be found (-n).
  6131.  
  6132.   While the second example is more general than the first, and either
  6133.   might be useful for Shell scripts (particularly when the -n option
  6134.   is used), the real use for MatchIt is as a generalization of the
  6135.   the Shell editor’s own double-clicking delimiter matching mechanism.
  6136.   The following example illustrates this purpose:
  6137.  
  6138.   addmenu Edit 'Match It/µ' 'matchit  -n -h ∂
  6139.   "{active}"  ≥ "{MPW}"Errors || ∂
  6140.   alert  < "{MPW}"Errors'
  6141.  
  6142.   This example places a MatchIt call into the Edit menu as the command
  6143.   Match It with a command key Option-m (the µ). A selection is made
  6144.   in the current (that is, the {active}) window and the menu command
  6145.   invoked (by pressing Command-Option-m). If the match is found, all
  6146.   characters from the initially selected delimiter to its mate are
  6147.   highlighted (-h). If a match is not found, or if any other errors
  6148.   occur, an alert dialog box appears containing the error message.
  6149.   An auxiliary file, "{MPW}"Errors, is used for this purpose.
  6150.  
  6151.   Of course, you might not be interested in displaying the dialog box
  6152.   because you can see that the selection doesn’t change if there are
  6153.   any errors. Furthermore, you might not want superfluous files laying
  6154.   around ("{MPW}"Errors—although you could create a more elaborate
  6155.   AddMenu command to always delete this file). Thus, you could make
  6156.   the following simplification:
  6157.  
  6158.   addmenu Edit 'Match It/µ' 'matchit  -h  "{active}"  ≥ dev:null'
  6159.  
  6160.   This example places a MatchIt call into the Edit menu but with all
  6161.   errors ignored when the MatchIt command is executed.
  6162.  
  6163.   Limitations MatchIt does not process conditionals (that is, Pascal
  6164.   $ifc, C #if, and so on) during its scan except to find matching pairs.
  6165.   This might confuse MatchIt’s scanning process. Similarily, C macros
  6166.   and "\" continuations may also confuse MatchIt.
  6167.  
  6168.   MatchIt only finds a right delimiter to the specified left delimiter.
  6169.   Right-to-left matching is not supported.
  6170.  
  6171. æKY MergeBranch
  6172. æC        MergeBranch -- merge a branch revision onto the trunk
  6173.  
  6174. MergeBranch file…
  6175.  
  6176. Status codes returned:
  6177.   0    No Errors.
  6178.   1    Syntax Error.
  6179.   2    Error in Processing.
  6180.   3    System Error.
  6181.  
  6182.                            Description
  6183.  
  6184.   Merge the branch revision of the HFS file file onto the trunk. The
  6185.   file must belong to a currently mounted project and must be a branch
  6186.   revision (that is, the revision number contains one or more letters).
  6187.  
  6188.   MergeBranch uses the ProjectInfo command to determine what project
  6189.   file belongs to and whether file is in fact a branch revision. If
  6190.   all of the file's revisions are older than the branch, the branch
  6191.   will be checked in as the latest trunk revision. Otherwise MergeBranch
  6192.   checks out the latest revision on the trunk and calls CompareFiles
  6193.   to allow the user to manually cut and paste changes from the branch
  6194.   into the trunk revision. When done, the user can check the modified
  6195.   trunk revision back into the project.
  6196.  
  6197.   MergeBranch uses the CompareFiles script.
  6198.  
  6199.  
  6200.                              Examples
  6201.  
  6202.   MergeBranch file.c
  6203.  
  6204.   This example merges the branch revision in the file "file.c" onto
  6205.   the trunk.
  6206.  
  6207.   AddMenu Project 'Merge Branch' 'Merge Branch {Active} ∑∑ {WorkSheet}'
  6208.  
  6209.   This example adds MergeBranch to the Project menu and allows you
  6210.   to merge branch revisions onto the trunk.
  6211.  
  6212.  
  6213.                              See also 
  6214.  
  6215.   CompareFiles.
  6216.  
  6217. æKY ModifyReadOnly
  6218. æC  ModifyReadOnly -- enables a read-only Projector file to be edited
  6219.  
  6220. ModifyReadOnly file …
  6221.  
  6222. Status codes returned:
  6223.   0    No errors.
  6224.   1    Syntax error.
  6225.   2    Error in processing.
  6226.  
  6227.                            Description
  6228.  
  6229.   Write-enable a file that has been checked out as read-only. After
  6230.   executing this command on a file, the modified read-only icon is
  6231.   displayed in the window.
  6232.  
  6233.   This command is most useful on those rare occasions when you need
  6234.   to modify a read-only file. For example, suppose you have taken a
  6235.   number of modifiable files home. You may have also brought along
  6236.   certain read-only copies of files that you did not expect to modify,
  6237.   but once you get into your work at home you discover that you do,
  6238.   after all, need to make changes in these files.
  6239.  
  6240.   Note that this command takes only a single file for a parameter.
  6241.   This "feature" was intentional so that this command would not be
  6242.   overused.
  6243.  
  6244.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  6245.   symbols used in Projector commands.
  6246.  
  6247.  
  6248.                              Examples
  6249.  
  6250.   Suppose file.c is checked out as read-only. You can write-enable
  6251.   it by using the ModifyReadOnly command:
  6252.  
  6253.   ModifyReadOnly file.c
  6254.  
  6255.   ProjectInfo :file.c -s
  6256.  
  6257.   The ProjectInfo command writes the following to standard output:
  6258.  
  6259.   file.c,5*
  6260.  
  6261.   Notice that an asterisk appears after the revision number when you
  6262.   get information about modified read-only files.
  6263.  
  6264.  
  6265.                              See also 
  6266.  
  6267.   CheckIn, CheckOut, CheckOutDir.
  6268.  
  6269. æKY Mount
  6270. æC                        Mount -- mount volumes
  6271.  
  6272. Mount drive…
  6273.  
  6274. Status codes returned:
  6275.   0    The disk was mounted.
  6276.   1    Syntax error.
  6277.   2    An error occurred.
  6278.  
  6279.                            Description
  6280.  
  6281.   Mounts the disks in the specified drives, making them accessible
  6282.   to the file system. Drive is the drive number.
  6283.  
  6284.   Mounting is normally automatic when a disk is inserted. The Mount
  6285.   command is needed for mounting multiple hard disks, which cannot
  6286.   be "inserted," or for volumes that have been unmounted via the Unmount
  6287.   command.
  6288.  
  6289.  
  6290.                              Examples
  6291.  
  6292.   Mount 1
  6293.  
  6294.   Mounts the disk in drive 1 (the internal drive).
  6295.  
  6296.  
  6297.                              See also 
  6298.  
  6299.   Unmount and Volumes commands.
  6300.  
  6301. æKY MountProject
  6302. æC                    MountProject -- mount projects
  6303.  
  6304. MountProject ([-s] [-pp] [-q] [-r]) | [Project]
  6305.  -s                      # print names only, not commands
  6306.  -pp                     # list mounted projects using project paths
  6307.  -q                      # don't quote names with special characters
  6308.  -r                      # list projects recursively
  6309.  
  6310. Status codes returned:
  6311.   0    No errors.
  6312.   1    Syntax error.
  6313.   2    Error in processing.
  6314.   3    System error.
  6315.  
  6316.                            Description
  6317.  
  6318.   MountProject mounts (establishes a connection to) the specified project.
  6319.   Project is the HFS path of the project directory for the project.
  6320.   Once a project is mounted, that project and all its subprojects can
  6321.   be accessed.
  6322.  
  6323.   MountProject commands typically appear in the UserStartup file, a
  6324.   script, or an AddMenu to automatically mount the projects you typically
  6325.   access.
  6326.  
  6327.   If project is omitted, a list of all root projects is written to
  6328.   standard output in the form of MountProject commands.
  6329.  
  6330.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  6331.   symbols used in Projector commands.
  6332.  
  6333.  
  6334.                              Examples
  6335.  
  6336.   MountProject FS:Zoom
  6337.   MountProject HD:localProjects:Test
  6338.  
  6339.   These commands mount the projects Zoom and Test.
  6340.  
  6341.   MountProject
  6342.   MountProject FS:MPW
  6343.   MountProject HD:localProjects:sort
  6344.  
  6345.   To obtain a list of the current root projects, execute the MountProject
  6346.   command without parameters.
  6347.  
  6348.  
  6349.                              See also 
  6350.  
  6351.   UnmountProject, Project, CheckOutDir.
  6352.  
  6353. æKY Move
  6354. æC                  Move -- move files and directories
  6355.  
  6356. Move [-y | -n | -c] [-p] name… target  ≥ progress
  6357.  -y                      # overwrite target files (avoids dialog)
  6358.  -n                      # don't overwrite target files (avoids dialog)
  6359.  -c                      # cancel if conflict occurs (avoids dialog)
  6360.  -p                      # write progress information to diagnostics
  6361.  
  6362. Status codes returned:
  6363.   0    All objects were moved.
  6364.   1    Syntax error.
  6365.   2    An error occurred during the move.
  6366.   4    Cancel was selected or implied with the -c option.
  6367.  
  6368.                            Description
  6369.  
  6370.   Moves name to targetName. (Name and targetName are file or directory
  6371.   names.) If targetName is a directory, one or more objects (files
  6372.   and/or directories) are moved into that directory. If targetName
  6373.   is a file or doesn’t exist, file or directory name replaces targetName.
  6374.   In either case, the old objects are deleted. Moved objects retain
  6375.   their current creation and modification dates.
  6376.  
  6377.   If a directory is moved, its contents, including all subdirectories,
  6378.   are also moved. No directory moved can be a parent of targetName.
  6379.  
  6380.   A dialog box requests a confirmation if the move would overwrite
  6381.   an existing file or folder. The -y, -n, or -c option can be used
  6382.   to avoid this interaction.
  6383.  
  6384.  
  6385.                              Examples
  6386.  
  6387.   Move Startup Suspend Resume Quit {SystemFolder}
  6388.  
  6389.   Moves the four files from the current directory to the System Folder.
  6390.  
  6391.   Move File ::
  6392.  
  6393.   Moves File from the current directory to the enclosing (parent) directory.
  6394.  
  6395.   Move -y File1 File2
  6396.  
  6397.   Moves File1 to File2, overwriting File2 if it exists. (This is the
  6398.   same as renaming the file.)
  6399.  
  6400.  
  6401.                              See also 
  6402.  
  6403.   Duplicate and Rename commands.
  6404.  
  6405.   "File and Window Names" in Chapter 4.
  6406.  
  6407.   "Filename Generation" in Chapter 5.
  6408.  
  6409. æKY MoveWindow
  6410. æC                 MoveWindow -- move window to h,v location
  6411.  
  6412. MoveWindow [h v] [-i] [window]
  6413.  h                       # horizontal position of top left corner
  6414.  v                       # vertical position of top left corner
  6415.  -i                      # ignore positioning errors
  6416.  
  6417. Status codes returned:
  6418.   0    No errors.
  6419.   1    Syntax error (error in parameters).
  6420.   2    The specified window does not exist.
  6421.   3    The h v location specified is invalid.
  6422.  
  6423.                            Description
  6424.  
  6425.   Moves the upper-left corner of the specified window to the location
  6426.   (h v), where h and v are horizontal and vertical integers, respectively.
  6427.   Use a space to separate the numbers h and v on the command line.
  6428.  
  6429.   The coordinates (0,0) are located at the left side of the screen
  6430.   at the bottom of the menu bar. If the location specified would place
  6431.   the window’s title bar entirely off the visible screen, an error
  6432.   is returned. (The -i option overrides the error.) If no window is
  6433.   specified, the target window (the second window from the front) is
  6434.   assumed. If no location is specified, the specified window’s location
  6435.   is returned without any effect on the window.
  6436.  
  6437.  
  6438.                              Examples
  6439.  
  6440.   MoveWindow 72 72
  6441.  
  6442.   Moves the target window’s upper-left corner to a point approximately
  6443.   one inch in from the upper-left corner of the screen, and one inch
  6444.   below the bottom of the menu bar. (There are about 72 pixels per
  6445.   inch on the Macintosh display screen.)
  6446.  
  6447.   MoveWindow
  6448.  
  6449.   Returns MoveWindow 72 72 when executed after the above example.
  6450.  
  6451.   MoveWindow 0 0 {Worksheet}
  6452.  
  6453.   Moves the Worksheet window to the upper-left corner of the screen
  6454.   (below the menu bar).
  6455.  
  6456.  
  6457.                              See also 
  6458.  
  6459.   SizeWindow, StackWindows, RotateWindows, TileWindows, and ZoomWindow
  6460.   commands.
  6461.  
  6462. æKY NameRevisions
  6463. æC                NameRevisions -- define a symbolic name
  6464.  
  6465. NameRevisions [-u User] [-project Project] [-public |private | -b] [-r]
  6466.      [[-only] | name [[-expand] [-s] | [-replace] [-dynamic] [names… | -a]]]
  6467.  -u user                 # name of current user
  6468.  -private                # create a private name
  6469.  -project project        # name of project that contains the revisions
  6470.  -public                 # create a public name
  6471.  -b                      # print both public and private names
  6472.  -expand                 # evaluate names to revision level before printing
  6473.  -only                   # only print the names, not the associated revisions
  6474.  -replace                # completely overwrite the previous definition of name
  6475.  -dynamic                # evaluate names to revision level when using not defining
  6476.  -r                      # recursively execute NameRevisions starting with current project
  6477.  -s                      # print a single name per line
  6478.  -a                      # all the files in the project
  6479.  
  6480. Status codes returned:
  6481.   0    No errors.
  6482.   1    Syntax error.
  6483.   2    Error in processing.
  6484.   3    System error.
  6485.  
  6486.                            Description
  6487.  
  6488.   Create a symbolic name to represent a set of revisions under Projector.
  6489.   Subsequently, when name is used in Projector commands, its value,
  6490.   names, is substituted in its place. Symbolic names are kept on a
  6491.   per-project basis and can be composed of filenames, revisions, branches,
  6492.   and other defined symbolic names. A symbolic name can include only
  6493.   one revision per file. The first character of a Name cannot be a
  6494.   digit (0–9). Also, commas, greater-than or less-than signs, (<, <,
  6495.   > >), or hyphens (-) are not allowed anywhere in a Name. Names are
  6496.   not case sensitive.
  6497.  
  6498.   If names is missing, the definition for name is listed. If name is
  6499.   missing, then NameRevisions lists all symbolic names in the project.
  6500.   In either case, the output is in the form of NameRevisions commands.
  6501.  
  6502.   By default, if names currently refers to a file listed in name, the
  6503.   revision for the file in name is modified to be the revision associated
  6504.   with the file in names. If there is a file in names which is not
  6505.   currently referred to by name, that file and revision is appended
  6506.   to name. To replace the definition of name, include the
  6507.  
  6508.   -replace option.
  6509.  
  6510.   The default is to create a private symbolic name. Include the -public
  6511.   option to make the symbolic name available to all users. You can
  6512.   add definitions for private symbolic names to UserStartup. Public
  6513.   symbolic name are stored with the project so they need to be defined
  6514.   only once. Do not put public symbolic name definitions in UserStartup.
  6515.  
  6516.   Projector checks for various errors both when a symbolic name is
  6517.   defined and when it is used. Errors include referring to a nonexistent
  6518.   file or referring to more than one revision in a file.
  6519.  
  6520.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  6521.   symbols used in Projector commands.
  6522.  
  6523.  
  6524.                              Examples
  6525.  
  6526.   Assuming the latest revisions of the files file.c and interactive.c
  6527.   are 9 and 13 respectively, the first example defines a symbolic name
  6528.   "Work" that always expands to the files file.c,9 and interactive.c,13.
  6529.  
  6530.   NameRevisions Work file.c interactive.c
  6531.  
  6532.   The following command:
  6533.  
  6534.   CheckOut Work
  6535.  
  6536.   Is equivalent to:
  6537.  
  6538.   CheckOut file.c,9 interactive.c,13
  6539.  
  6540.   By omitting the Names parameter, the next NameRevisions command generates
  6541.   the current definition of Work.
  6542.  
  6543.   NameRevisions Work
  6544.   NameRevisions Work file.c,9 interactive.c,13
  6545.  
  6546.   The -dynamic is an important option. The following two commands illustrate
  6547.   its function:
  6548.  
  6549.   NameRevisions fred file.c
  6550.   NameRevisions -dynamic fred file.c
  6551.  
  6552.   The first command defines a symbolic name "fred" that always expands
  6553.   to the latest revision of file.c when fred was defined. The second
  6554.   example expands to the latest revision at the time of use. If the
  6555.   latest revision of file.c at the time fred was defined was 7 and
  6556.   the current latest revision is 9, the second NameRevisions command
  6557.   is equivalent to
  6558.  
  6559.   NameRevisions fred file.c,9
  6560.  
  6561.   The next command creates the symbolic name "file.c" that expands
  6562.   to the second revision off the first branch off the 1.1 revision
  6563.   of file.c.
  6564.  
  6565.   NameRevisions file.c file.c,1.1a2
  6566.  
  6567.   The command
  6568.  
  6569.   CheckOut file.c
  6570.  
  6571.   checks out revision 1.1a2 of file.c. The next example creates a Name
  6572.   "file.c" that expands to the latest version of the first branch off
  6573.   the 1.1 revision of file.c.
  6574.  
  6575.   NameRevisions -dynamic file.c file.c,1.1a
  6576.  
  6577.   So the checkout command
  6578.  
  6579.   CheckOut file.c
  6580.  
  6581.   will check out the latest revision on the first branch off revision
  6582.   1.1 of file.c.
  6583.  
  6584.   The next example defines all the latest revisions in the project
  6585.   Kerfroodi to be part of "v1.0 B1". Because this a global name, all
  6586.   users accessing the Kerfroodi project will be able to use the name
  6587.   "v1.0 B1".
  6588.  
  6589.   NameRevisions -public "vB1 1.0" -project Kerfroodi -a
  6590.  
  6591.   The name "BetaRelease" is defined recursively for all projects within
  6592.   the Zoom project:
  6593.  
  6594.   NameRevisions -project Zoom∫ -r "BetaRelease" -a
  6595.  
  6596.   Its behavior is the same as executing the following commands individually:
  6597.  
  6598.   NameRevisions -project Zoom "BetaRelease" -a
  6599.   NameRevisions -project Zoom∫Vroom "BetaRelease" -a
  6600.   NameRevisions -project Zoom∫Utilities "BetaRelease" -a
  6601.   NameRevisions -project Zoom∫Utilities∫Port "BetaRelease" -a
  6602.   ...
  6603.  
  6604.  
  6605.                              See also 
  6606.  
  6607.   ProjectInfo, DeleteNames.
  6608.  
  6609. æKY New
  6610. æC                       New -- open a new window
  6611.  
  6612. New [name…]
  6613.  
  6614. Status codes returned:
  6615.   0    No errors.
  6616.   1    Syntax error (error in parameters).
  6617.   2    Unable to complete operation; a file with the specified name already exists.
  6618.   3    System error.
  6619.  
  6620.                            Description
  6621.  
  6622.   Opens a new window as the active (frontmost) window. If name is not
  6623.   specified, the Shell generates a unique name for the new window,
  6624.   of the form "Untitled-n", where n is a decimal number. If name already
  6625.   exists, an error results.
  6626.  
  6627.   You can use New to open several new windows by specifying a list
  6628.   of names separated by spaces. Note that New differs from Open -n
  6629.   by returning an error if the file already exists, whereas Open -n
  6630.   either opens an existing file or creates a new file.
  6631.  
  6632.   If the Shell variable {NewWindowRect} is defined, the windows are
  6633.   opened to that size and location.
  6634.  
  6635.  
  6636.                              Examples
  6637.  
  6638.   New
  6639.  
  6640.   Opens a new window with a Shell-generated name.
  6641.  
  6642.   New Test.a Test.p Test.c
  6643.  
  6644.   Creates three windows called Test.a, Test.p, and Test.c.
  6645.  
  6646.  
  6647.                              See also 
  6648.  
  6649.   Open command.
  6650.  
  6651. æKY Newer
  6652. æC             Newer -- compare modification dates of files
  6653.  
  6654. Newer [-c] [-e] [-q] file… target > newer
  6655.  -c               # compare creation dates
  6656.  -e               # report names that have same (equal) mod date as target
  6657.  -q               # don't quote file names with special characters
  6658.  
  6659. Status codes returned:
  6660.   0    No error.
  6661.   1    Syntax error.
  6662.   2    File not found.
  6663.  
  6664.                            Description
  6665.  
  6666.   Compares the modification dates of name and target. Files that have
  6667.   a more recent modification date than target have their names written
  6668.   to standard output. If the target is a nonexistent file or directory,
  6669.   all names that exist are considered newer than the target.
  6670.  
  6671.  
  6672.                              Examples
  6673.  
  6674.   Newer main.c main.c.bak
  6675.  
  6676.   Writes out main.c if its modification date is more recent than its
  6677.   backup.
  6678.  
  6679.   Newer HD:Source:≈.c HD:TimeStamp
  6680.  
  6681.   Writes to the screen all the source files in the Source directory
  6682.   that have been modified since the modification date of TimeStamp.
  6683.  
  6684.   If `Newer main.c main.c.bak`
  6685.     Duplicate main.c main.c.bak
  6686.   End
  6687.  
  6688.   Makes a backup copy of main.c only if it has been modified since
  6689.   the last backup was made.
  6690.  
  6691.   If "`Newer File.c File.h File.c.o`"
  6692.     C File.c -o file.c.o
  6693.   End
  6694.  
  6695.   Rebuilds the source file file.c if either file.c or file.h has been
  6696.   modified since file.c.o was last built.
  6697.  
  6698. æKY NewFolder
  6699. æC                   NewFolder -- create a new folder
  6700.  
  6701. NewFolder name…
  6702.  
  6703. Status codes returned:
  6704.   0    Folders were created for each name listed.
  6705.   1    Syntax error.
  6706.   2    An error occurred.
  6707.   3    Attempt to use NewFolder on a non-HFS volume.
  6708.  
  6709.                            Description
  6710.  
  6711.   Creates new directories with the names specified. Any parent directories
  6712.   included in the name specification must already exist.
  6713.  
  6714.     • Note: This command can be used only on hierarchical file system
  6715.     (HFS) disks.
  6716.  
  6717.  
  6718.                              Examples
  6719.  
  6720.   NewFolder Memos
  6721.  
  6722.   Creates Memos as a subdirectory of the current directory.
  6723.  
  6724.   NewFolder Parent :Parent:Kid
  6725.  
  6726.   Creates Parent as a subdirectory of the current directory, and Kid
  6727.   as a subdirectory of Parent.
  6728.  
  6729. æKY NewProject
  6730. æC                  NewProject -- create a new project
  6731.  
  6732. NewProject -w | -close | ([-u user] [-cs comment | -cf file] project)
  6733.  -cf file                # the comment is contained in file.
  6734.  -close                  # close the New Project window
  6735.  -cs comment             # a short description of the project
  6736.  -w                      # open the New Project window
  6737.  -u user                 # name of current user
  6738.  
  6739. Status codes returned:
  6740.   0    No errors.
  6741.   1    Syntax error.
  6742.   2    Error in processing.
  6743.   3    System error.
  6744.  
  6745.                            Description
  6746.  
  6747.   NewProject creates a project under control of Projector. A project
  6748.   directory is created to store the files, subprojects, and other information
  6749.   related to the project. The name of the directory is the name of
  6750.   the project.
  6751.  
  6752.   If project is a project pathname (such as MPW∫Tools∫Enterprise),
  6753.   Projector creates Enterprise as a subproject of the existing MPW∫Tools
  6754.   project. In this case MPW∫Tools must be a mounted project (see the
  6755.   MountProject command).
  6756.  
  6757.   If project is a leafname (such as Enterprise), project directory
  6758.   Enterprise is created in the current directory.
  6759.  
  6760.   Finally, if project is a partial or full HFS pathname (such as :Work:Enterprise
  6761.   or FS:Projects:Enterprise), the project Enterprise is created in
  6762.   the HFS location specified.
  6763.  
  6764.   Add a MountProject command to the UserStartup file, a script, or
  6765.   AddMenu to easily mount the new project.
  6766.  
  6767.   The checkout directory is initially set to the current directory
  6768.   (:). To change the checkout directory, refer to the CheckOutDir command.
  6769.  
  6770.   To add files to the new project, use the CheckIn command (with the
  6771.   -new option) or the Check In window.
  6772.  
  6773.   See Chapter 7 of the MPW manual for complete definitions of the terms and
  6774.   symbols used in Projector commands.
  6775.  
  6776.  
  6777.                              Examples
  6778.  
  6779.   The following command creates a project Enterprise in the current
  6780.   directory. No comment is saved with the project, but you can add
  6781.   one later by selecting the project in the Check Out window's /Info
  6782.   view.
  6783.  
  6784.   NewProject Enterprise
  6785.  
  6786.   The next example creates a project Zoom in the FS:work:Zoom. The
  6787.   -cf option indicates that the comment for the new project is contained
  6788.   in the file Info.
  6789.  
  6790.   NewProject FS:work:Zoom -cf Info
  6791.  
  6792.   Finally, given that the project Enterprise∫Utilities exists and has
  6793.   been mounted using the MountProject command, the next command creates
  6794.   a Zoom project in the Enterprise∫Utilities project. In this case
  6795.   you don’t need to add a MountProject command to UserStartup, but
  6796.   you may want to add a CheckOutDir command to set the checkout directory.
  6797.  
  6798.   NewProject Enterprise∫Utilities∫Zoom -cs ∂
  6799.   "Upgrade Zoom utility"
  6800.  
  6801.  
  6802.                              See also 
  6803.  
  6804.   CheckOutDir, MountProject, Project.
  6805.  
  6806. æKY Open
  6807. æC                  Open -- open file(s) in window(s)
  6808.  
  6809. Open [-n | -r] [-t] [name…]
  6810.  -n                      # open new file (default name Untitled)
  6811.  -r                      # open file for read-only use
  6812.  -t                      # open file as the target window
  6813.  
  6814. Status codes returned:
  6815.   0    No errors.
  6816.   1    Error in parameters.
  6817.   2    Unable to complete operation; specified file not found.
  6818.   3    System error.
  6819.  
  6820.                            Description
  6821.  
  6822.   Opens a file as the active (frontmost) window. If name is not specifed,
  6823.   StdFile’s GetFile routine is called, allowing you to use a dialog
  6824.   box to choose a file. If name is already open as a window, that window
  6825.   becomes the active (frontmost) window.
  6826.  
  6827.  
  6828.                              Examples
  6829.  
  6830.   Open
  6831.  
  6832.   Displays StdFile from which to choose a file to open.
  6833.  
  6834.   Open -r -t Test.a
  6835.  
  6836.   Opens the file Test.a as the target window, read-only.
  6837.  
  6838.   Open ≈.a
  6839.  
  6840.   Opens all the files that end with ".a".
  6841.  
  6842.  
  6843.                              See also 
  6844.  
  6845.   Target, New, and Close commands.
  6846.  
  6847. æKY OrphanFiles
  6848. æC  OrphanFiles -- remove Projector information from a list of files
  6849.  
  6850. OrphanFiles file…
  6851.  
  6852. Status codes returned:
  6853.   0    No errors.
  6854.   1    Syntax error.
  6855.   2    Error in processing.
  6856.  
  6857.                            Description
  6858.  
  6859.   Remove the 'CKID' resource from file(s). This removes the identification
  6860.   information from the file that Projector uses to uniquely identify it.
  6861.  
  6862.     • Warning Once the projector information is removed from a file,
  6863.     you cannot check the file back into the Project as a checked-out
  6864.     file.
  6865.  
  6866.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  6867.   symbols used in Projector commands.
  6868.  
  6869.  
  6870.                              Examples
  6871.  
  6872.   Suppose file.c and interactive.c belong to a project that has been
  6873.   deleted. We can remove the Projector information from them (so that
  6874.   they can be used for other purposes) with the command
  6875.  
  6876.   OrphanFiles file.c interactive.c
  6877.  
  6878.  
  6879.                              See also 
  6880.  
  6881.   TransferCkid.
  6882.  
  6883. æKY Parameters
  6884. æC                    Parameters -- write parameters
  6885.  
  6886. Parameters [parameter…]  > parameters
  6887.  
  6888. Status codes returned:   
  6889.   0    no errors is always returned.
  6890.  
  6891.                            Description
  6892.  
  6893.   The Parameters command writes its parameters, including its name,
  6894.   to standard output. The parameters are written one per line, and
  6895.   each is preceded by its parameter number (in braces) and a blank.
  6896.   This command is useful for checking the results of variable substitution,
  6897.   command substitution, quoting, blank interpretation, and filename
  6898.   generation.
  6899.  
  6900.  
  6901.                              Examples
  6902.  
  6903.   Parameters One Two "and Three"
  6904.  
  6905.   Writes the following four lines to standard output:
  6906.  
  6907.   {0} Parameters
  6908.   {1} One
  6909.   {2} Two
  6910.   {3} and Three
  6911.  
  6912.   Recall that "…" and '…' quotation marks are removed before parameters
  6913.   are passed to commands.
  6914.  
  6915.  
  6916.                              See also 
  6917.  
  6918.   Echo and Quote commands.
  6919.  
  6920.   "Parameters to Scripts" in Chapter 5.
  6921.  
  6922. æKY Pascal
  6923. æC                      Pascal -- Pascal compiler
  6924.  
  6925. Pascal [option…] [file…]  < file ≥ progress
  6926.     -b                   # generate A5 references for procedure addresses
  6927.     -c                   # syntax check only, don't create object file
  6928.     -clean               # erase all symbol table resources
  6929.     -d name=(TRUE|FALSE) # set compile time variable name
  6930.     -e file              # write errors to file
  6931.     -forward             # allow only explicit forward and external object declarations
  6932.     -h                   # suppress error messages regarding unsafe handles
  6933.     -i directory,…       # search for includes in directory,…
  6934.     -k directory         # create symbol table resource files in directory
  6935.     -m                   # allow greater than 32K globals by using 32 bit
  6936.     -mbg ch8             # include v2.0 compatible MacsBug symbols
  6937.     -mbg full            # include full (untruncated) symbols for MacsBug
  6938.     -mbg off             # don't include symbols for MacsBug
  6939.     -mbg number          # include MacsBug symbols truncated to length 
  6940.                          # number
  6941.     -mc68020             # generate MC68020 code 
  6942.     -mc68881             # generate MC68881 code for floating point operations
  6943.      -model farCode|     # generate load-time relocatable 32-bit references for
  6944.          farData|far     #   code, data, or both
  6945.      -model nearCode|    # generate 16-bit references for code, data, or both 
  6946.          nearData|near   #   (the default)
  6947.     -n                   # generate separate global data modules for better allocation
  6948.     -noload              # don't use or create any symbol table resources
  6949.     -o objname           # generate code in file or directory objname
  6950.     -only name…          # only generate code for named modules
  6951.     -ov                  # generate code to test for overflow
  6952.     -opt off             # don't apply code optimizations
  6953.     -opt on | full       # choose level of code optimization (full is default);
  6954.                          #   can modify with [,nopeep] [,nostatic]
  6955.     -p                   # write progress information to diagnostics
  6956.     -r                   # don't generate range checking code
  6957.     -rebuild             # rebuild all symbol table resources
  6958.     -sym off             # don't generate SADE records
  6959.     -sym on | full       # generate SADE records; can modify with [,nolines] [,notypes] [,novars]
  6960.     -t                   # write compilation time to diagnostics
  6961.     -u                   # initialize all data to $7267 for debugging use
  6962.     -w                   # don't perform peephole optimization
  6963.     -y directory         # create temporary files in directory
  6964.  
  6965. Status codes returned:
  6966.   0    Successful completion.
  6967.   1    Error in parameters.
  6968.   2    Compilation halted.
  6969.  
  6970.                            Description
  6971.  
  6972.   Compiles the specified Pascal source files (programs or units). You
  6973.   can specify zero or more filenames. Each file is compiled separately—compiling
  6974.   file Name .p creates object file Name .p.o. By convention, Pascal
  6975.   source filenames end in a ".p" suffix.
  6976.  
  6977.   See the MPW 3.0 Pascal Reference for details of the language definition.
  6978.  
  6979.  
  6980.                              Examples
  6981.  
  6982.   Pascal Sample.p
  6983.  
  6984.   Compiles the Sample program provided in the PExamples folder.
  6985.  
  6986.   Pascal File1.p File2.p -r
  6987.  
  6988.   Compiles File1.p and File2.p, producing object files File1.p.o and
  6989.   File2.p.o but performing no range checking.
  6990.  
  6991.     • Note: Listing files are not produced directly by the compiler.
  6992.     Refer to the PasMat and PasRef tools.
  6993.  
  6994.   Availability The MPW Pascal compiler is available as a separate Apple
  6995.   product.
  6996.  
  6997.  
  6998.                              See also 
  6999.  
  7000.   PasMat and PasRef commands.
  7001.  
  7002.   MPW 3.0 Pascal Reference.
  7003.  
  7004. æKY PasMat
  7005. æC                  PasMat -- Pasca programs formatter
  7006.  
  7007. PasMat [option…] [input [output]]  < input > output ≥ progress
  7008.  -a                      # set a-  disable CASE label bunching
  7009.  -b                      # set b+  enable IF bunching
  7010.  -body                   # set body+ to disable indenting procedure bodies
  7011.  -c                      # set c+  suppress Return before BEGIN
  7012.  -d                      # set d+  use {…} comment delimiters
  7013.  -e                      # set e+  capitalize identifiers
  7014.  -entab                  # replace multiple blanks with tabs
  7015.  -f                      # set f-  disable formatting
  7016.  -g                      # set g+  group assignment and call statements
  7017.  -h                      # set h-  disable FOR, WHILE, WITH bunching
  7018.  -i directory,…          # search for includes in directory,…
  7019.  -in                     # set in+ process includes
  7020.  -k                      # set k+  indent statements between BEGIN and END
  7021.  -l                      # set l+  literally copy reserved words, identifiers
  7022.  -list file              # write listings to file
  7023.  -n                      # set n+  group formal parameters
  7024.  -o width                # set output line width (default 80)
  7025.  -p                      # write progress information to diagnostics
  7026.  -pattern -old-new-      # modify include names, changing old to new
  7027.  -q                      # set q+  no special ELSE IF formatting
  7028.  -r                      # set r+  upper case reserved words
  7029.  -rec                    # set rec+ to indent field lists under defined id
  7030.  -s file                 # substitute identifiers based on pairs in file
  7031.  -t tab                  # set output tab setting (default 2)
  7032.  -u                      # rename identifiers to match first occurence
  7033.  -v                      # set v+  put THEN on separate line
  7034.  -w                      # set w+  upper case identifiers
  7035.  -x                      # set x+  suppress space around operators
  7036.  -y                      # set y+  suppress space around :=
  7037.  -z                      # set z+  suppress space after commas
  7038.  -:                      # set :+  align colons in VAR declarations
  7039.  -@                      # set @+  multiple CASE tags on separate lines
  7040.  -∂#                     # set #+  smart grouping of assignments and calls
  7041.  -_                      # set _+  delete _ from identifiers
  7042.  
  7043. Status codes returned:
  7044.   0    Normal termination.
  7045.   1    Parameter or option error.
  7046.  
  7047.                            Description
  7048.  
  7049.   Reformats Pascal source code into a standard format, suitable for
  7050.   printouts or compilation. PasMat accepts full programs, external
  7051.   procedures, blocks, and groups of statements.
  7052.  
  7053.     • Note: A syntactically incorrect program causes PasMat to abort.
  7054.     If this happens, the generated output will contain the formatted
  7055.     source up to the point of the error.
  7056.  
  7057.   PasMat options let you do the following:
  7058.  
  7059.     • Convert a program to uniform case conventions.
  7060.  
  7061.     • Indent a program to show its logical structure, and adjust
  7062.     lines to fit into a specified line length.
  7063.  
  7064.     • Change the comment delimiters ( * * ) to { } .
  7065.  
  7066.     • Remove the underscore character ( _ ) from identifiers, rename
  7067.     identifiers, or change their case.
  7068.  
  7069.     • Format include files named in MPW Pascal include directives.
  7070.  
  7071.   PasMat specifications can be made through PasMat options or through
  7072.   special formatter directives, which resemble Pascal compiler directives,
  7073.   and are inserted into the source file as Pascal comments. PasMat’s
  7074.   default formatting is straightforward and does not require you to
  7075.   use any options. The best way to find out how PasMat formats something
  7076.   is to try out a small example.
  7077.  
  7078.   See Appendix K of the MPW 3.0 Pascal Reference for details of PasMat
  7079.   directives and their functions. The first dialog box of the Pascal
  7080.   Commando dialog is reproduced here for your convenience.
  7081.  
  7082.  
  7083.                              Examples
  7084.  
  7085.   Pasmat -n -u -r -d -pattern "==formatted/=" Sample.p ∂
  7086.   "formatted/Sample.p"
  7087.  
  7088.   Formats the file Sample.p with the -n, -u, -r, and -d options and
  7089.   writes the output to the file "formatted/Sample.p". Include files
  7090.   are processed
  7091.  
  7092.   ( -pattern ), and each Pascal compiler $I include file causes additional
  7093.   output files to be generated. Each of these files is created with
  7094.   the name "formatted/ filename ", where filename is the filename specified
  7095.   in the corresponding include. (The -pattern parameter contains a
  7096.   null pattern (==) with "formatted/" as a replacement string—a null
  7097.   pattern always matches the start of a string.)
  7098.  
  7099.   Care must be taken when a command line contains quotes, slashes,
  7100.   or other special characters that are processed by the Shell itself.
  7101.   In this example, we used the slash character, so the strings containing
  7102.   it had to be quoted.
  7103.  
  7104.   Limitations PasMat has these limitations:
  7105.  
  7106.     • The maximum length of an input line is 255 characters.
  7107.  
  7108.     • The maximum output line length is 150 characters.
  7109.  
  7110.     • The input files and output files must be different.
  7111.  
  7112.     • Only syntactically correct programs, units, blocks, procedures,
  7113.     and statements are formatted. This limitation must be taken into
  7114.     consideration when separate MPW 3.0 include files and conditional
  7115.     compiler directives are to be formatted.
  7116.  
  7117.     • The Pascal include directive should be the last thing on the
  7118.     input line if include files are to be processed. Include files
  7119.     are processed to a maximum nesting depth of five. All include
  7120.     files not processed are summarized at the end of formatting.
  7121.     (This assumes, of course, that the in directive/option is in
  7122.     effect.)
  7123.  
  7124.     • The identifiers CYCLE and LEAVE are treated as reserved Pascal
  7125.     keywords by PasMat. They are treated as two loop control statements
  7126.     by Pascal unless explicitly declared.
  7127.  
  7128.     • While Pasmat supports Pascal’s $$Shell facility in include
  7129.     files, the processing of MPW’s {PInterfaces} files is not fully
  7130.     supported because these files conditionally include files (remember,
  7131.     conditionals are not processed). For this reason, do not use
  7132.     the -in or -e option to process files that include MPW {PInterfaces}
  7133.     files.
  7134.  
  7135.   Availability PasMat is available as part of a separate Apple product,
  7136.   MPW 3.0 Pascal .
  7137.  
  7138.  
  7139.                              See also 
  7140.  
  7141.   Pascal and PasRef commands.
  7142.  
  7143.   Appendix K of the MPW 3.0 Pascal Reference.
  7144.  
  7145. æKY PasRef
  7146. æC                  PasRef -- Pascal cross-referencer
  7147.  
  7148. PasRef [option…] [file…]  < file > crossReference ≥ progress
  7149.  -a                      # process includes and units each time encountered
  7150.  -c                      # process includes and units only once
  7151.  -cond                   # process $SETC and $IFC, $ELSEC, $ENDC conditionals
  7152.  -d                      # process each file separately
  7153.  -d name=TRUE|FALSE      # set $SETC variable name to TRUE or FALSE
  7154.  -i directory,…          # search for includes in directory,…
  7155.  -l                      # write identifiers in lower case
  7156.  -mc68020                # source contains {$IFC OPTION(MC68020)} directives
  7157.  -mc68881                # source contains {$IFC OPTION(MC68881)} directives
  7158.  -n                      # don't process USES or includes
  7159.  -ni | -noi[ncludes]     # don't process include files
  7160.  -nl | -nol[istings]     # don't list the input
  7161.  -nolex                  # don't write lexical information
  7162.  -nt | -not[otal]        # don't write total line count
  7163.  -nu | -nou[ses]         # don't process USES declarations   
  7164.  -o                      # source written using Object Pascal
  7165.  -p                      # write progress information to diagnostics
  7166.  -s                      # don't write include and USES filenames
  7167.  -t                      # cross reference by total line number
  7168.  -u                      # write identifiers in upper case
  7169.  -w width                # set output line width (default 110)
  7170.  -x width                # set maximum identifier width
  7171.  
  7172. Status codes returned:
  7173.   0    Normal termination.
  7174.   1    Parameter or option error.
  7175.  
  7176.                            Description
  7177.  
  7178.   Reads Pascal source files and writes a listing of the source followed
  7179.   by a cross-reference listing of all identifiers. Each identifier
  7180.   is listed in alphabetical order, followed by the number of the line
  7181.   on which it appears. Line numbers can refer to the entire source
  7182.   file, or can be relative to individual include files and units. Each
  7183.   reference indicates whether the identifier is defined, assigned,
  7184.   or simply named (for example, used in an expression).
  7185.  
  7186.   See the MPW 3.0 Pascal Reference for more information about the Pascal
  7187.   language. The first dialog box of PasRef’s Commando dialog is reproduced
  7188.   here for your convenience.
  7189.  
  7190.   Identifiers may be up to 63 characters long and are displayed in
  7191.   their entirety unless overridden with the -x directive. Identifiers
  7192.   can remain as they appear in the input, or they can be converted
  7193.   to all lowercase (-l ) or all uppercase (-u).
  7194.  
  7195.   For include files, line numbers are relative to the start of the
  7196.   include file; an additional key number indicates which include file
  7197.   is referred to. A list of each include file processed and its associated
  7198.   key number is displayed prior to the cross-reference listing.
  7199.  
  7200.   USES declarations can also be processed by PasRef (their associated
  7201.   $U filename compiler directives are processed as in the Pascal compiler).
  7202.   These declarations are treated exactly like includes, and, as with
  7203.   the compiler, only the outermost USES declaration is processed (that
  7204.   is, a used unit’s USES declaration is not processed).
  7205.  
  7206.   As an alternative to processing USES declarations, PasRef accepts
  7207.   multiple source files. Thus you cross-reference a set of main programs
  7208.   together with the units they use. All the sources are treated like
  7209.   include files for display purposes. In addition, PasRef checks to
  7210.   see whether it has already processed a file (for example, if it appeared
  7211.   twice on the input list, or if one of the files already used or included
  7212.   it). The file is skipped it has already been processed.
  7213.  
  7214.  
  7215.                              Examples
  7216.  
  7217.   PasRef -nu -w 80 Memory.p > Memory.p.Xref
  7218.  
  7219.   Cross-references the sample desk accessory Memory.p and writes the
  7220.   output to the file Memory.p.Xref. No USES declarations are processed
  7221.   (-nu). The following source and cross-reference listings are generated:
  7222.  
  7223.   1 1 1 -- {
  7224.   2 1 2 -- File Memory.p
  7225.   3 1 3 --
  7226.   4 1 4 -- Copyright Apple Computer, Inc. 1985-1987
  7227.   5 1 5 -- All rights reserved.
  7228.   6 1 6 -- }
  7229.   7 1 7 --
  7230.   8 1 8 -- {$D+} { MacsBug symbols on }
  7231.   9 1 9 -- {$R-} { No range checking }
  7232.   10 1 10 --
  7233.   11 1 11 -- UNIT Memory;
  7234.   12 1 12 --
  7235.   13 1 13 -- INTERFACE
  7236.   14 1 14 --
  7237.   15 1 15 -- USES
  7238.   16 1 16 -- MemTypes, QuickDraw, OSIntf, ToolIntf, PackIntf;
  7239.   17 1 17 --
  7240.   18 1 18 --
  7241.   19 1 19 -- FUNCTION DRVROpen (ctlPB: ParmBlkPtr; dCtl: DCtlPtr):OSErr;
  7242.   20 1 20 -- FUNCTION DRVRControl (ctlPB: ParmBlkPtr; dCtl: DCtlPtr):OSErr;
  7243.   21 1 21 -- FUNCTION DRVRStatus (ctlPB: ParmBlkPtr; dCtl:.DCtlPtr):OSErr;
  7244.   22 1 22 -- FUNCTION DRVRPrime (ctlPB: ParmBlkPtr; dCtl: DCtlPtr):OSErr;
  7245.   23 1 23 -- FUNCTION DRVRClose (ctlPB: ParmBlkPtr; dCtl: DCtlPtr):OSErr;
  7246.   24 1 24 --
  7247.   25 1 25 --
  7248.   26 1 26 -- IMPLEMENTATION
  7249.   etc.
  7250.  
  7251.   63 1 63 --A FUNCTION DRVRClose (ctlPB: ParmBlkPtr; dCtl: DCtlPtr):OSErr;
  7252.   64 1 64 0-A BEGIN
  7253.   65 1 65 -- IF dCtl^.dCtlwindow <> NIL THEN
  7254.   66 1 66 1- BEGIN
  7255.   67 1 67 -- DisposeWindow (WindowPtr(dCtl^.dCtlWindow));
  7256.   68 1 68 -- dCtl^.dCtlWindow := NIL;
  7257.   69 1 69 -1 END;
  7258.   70 1 70 -- DRVRClose := NOErr;
  7259.   71 1 71 -0A END;
  7260.   etc.
  7261.  
  7262.   178 1 178 --
  7263.   179 1 179 -- END. {of memory UNIT}
  7264.   180 1 180 --
  7265.  
  7266.   Each line of the source listing is preceded by five columns of information:
  7267.  
  7268.   1. The total line count.
  7269.  
  7270.   2. The include key assigned by PasRef for an include or USES file.
  7271.   (See below.)
  7272.  
  7273.   3. The line number within the include or main file.
  7274.  
  7275.   4. Two indicators (left and right) that reflect the static block
  7276.   nesting level. The left indicator is incremented (mod 10) and displayed
  7277.   whenever a BEGIN, REPEAT, or CASE is encountered. On termination
  7278.   of these structures with an END or UNTIL, the right indicator is
  7279.   displayed, then decremented. It is thus easy to match BEGIN, REPEAT,
  7280.   and CASE statements with their matching terminations.
  7281.  
  7282.   5. A letter that reflects the static level of procedures. The character
  7283.   is updated for each procedure nest level ("A" for level 1, "B" for
  7284.   level 2, and so on), and displayed on the line containing the heading,
  7285.   and on the BEGIN and END associated with the procedure body. Using
  7286.   this column you can easily find the procedure body for a procedure
  7287.   heading when there are nested procedures declared between the heading
  7288.   and its body.
  7289.  
  7290.   The cross-reference listing follows:
  7291.  
  7292.   1. Memory.p
  7293.  
  7294.   -A-
  7295.  
  7296.   accEvent 144 ( 1)
  7297.   accRun 158 ( 1)
  7298.   ApplicZone 121 ( 1)
  7299.   Away 33* ( 1) 146 ( 1)
  7300.  
  7301.   -B-
  7302.  
  7303.   BeginUpdate 151 ( 1)
  7304.   BNOT 39 ( 1)
  7305.   Bold ( 1) 117 ( 1)
  7306.   Boolean 31* ( 1)
  7307.   BOR 39 ( 1)
  7308.   BSL 39 ( 1)
  7309.  
  7310.   -C-
  7311.  
  7312.   csCode 143 ( 1)
  7313.   CSParam 146 ( 1)
  7314.   ctlPB 19* ( 1) 20*( 1) 21*( 1) 22*( 1)..23*( 1) 43*( 1)
  7315.         63* ( 1) 74*( 1) 143 ( 1) 146 ( 1) 168*( 1) 173*( 1)
  7316.  
  7317.   -D-
  7318.  
  7319.   dCtl 19* ( 1) 20*( 1) 21*( 1) 22*( 1) 23*( 1) 37*( 1)
  7320.        39  ( 1) 43*( 1) 50 ( 1) 53 ( 1) 54 ( 1) 55 ( 1)
  7321.        63* ( 1) 65 ( 1) 67 ( 1) 68 ( 1) 74*( 1) 115 ( 1)
  7322.        142 ( 1) 168*( 1) 173*( 1)
  7323.   DCtlPtr 19 ( 1) 20 ( 1) 21 ( 1) 22 ( 1) 23 ( 1) 37 ( 1)
  7324.           43 ( 1) 63 ( 1) 74 ( 1) 168 ( 1) 173 ( 1)
  7325.   dCtlRefNum 39 ( 1) 54 ( 1)
  7326.   dCtlWindow 50 ( 1) 55=( 1) 67 ( 1) 68=( 1) 142 ( 1)
  7327.   etc.
  7328.  
  7329.   -V-
  7330.  
  7331.   VolName 79* ( 1) 100 ( 1) 135 ( 1)
  7332.  
  7333.   -W-
  7334.  
  7335.   what 149 ( 1)
  7336.   WindowKind 54= ( 1)
  7337.   windowpeek 54 ( 1)
  7338.   WindowPtr 48 ( 1) 67 ( 1) 151 ( 1) 153 ( 1)
  7339.   wRect 47* ( 1)
  7340.  
  7341.   *** End PasRef: 105 id's 249 references
  7342.  
  7343.   The numbers in parentheses following the line numbers are the include
  7344.   keys of the associated include files (shown in column 2 of the source
  7345.   listing). The include filenames are shown following the source listing.
  7346.   You can thus see what line number was in which include file. An asterisk
  7347.   (*) following a line number indicates a definition of the variable.
  7348.   An equal sign (=) indicates an assignment. A line number with nothing
  7349.   following it indicates a reference to the identifier.
  7350.  
  7351.   Limitations PasRef has these limitations:
  7352.  
  7353.     • PasRef does not process conditional compilation directives!
  7354.     Thus, given the "right" combination of $IFCs and $ELSECs, PasRef’s
  7355.     lexical (nesting) information can be thrown off. If this happens,
  7356.     or if you don’t want the lexical information, you can specify
  7357.     the -nolex option.
  7358.  
  7359.     • PasRef stores all its information on the Pascal heap. Up to
  7360.     5000 identifiers can be handled, but more identifiers will mean
  7361.     less cross-reference space. A message appears if PasRef runs
  7362.     out of heap space.
  7363.  
  7364.     • Note: Although PasRef never misses a reference, it can infrequently
  7365.     be fooled into thinking that a variable is defined when it actually
  7366.     isn’t. One case where this happens is in record structure variants.
  7367.     The record variant’s case tag is always flagged as a definition
  7368.     (even when there is no tag type) and the variant’s case label
  7369.     constants (if they are identifiers) are also sometimes incorrectly
  7370.     flagged, depending on the context. (This occurs only in the declaration
  7371.     parts of the program.)
  7372.  
  7373.     • While PasRef supports Pascal’s $$Shell facility in include
  7374.     files and USES declarations, the processing of MPW’s {PInterfaces}
  7375.     files is not fully supported because these files conditionally
  7376.     include files (remember, conditionals are not processed). For
  7377.     this reason, always use the -nu option to suppress processing
  7378.     of USES declarations.
  7379.  
  7380.     • The identifiers CYCLE and LEAVE are treated as reserved Pascal
  7381.     keywords by PasRef. These are treated as two loop control statements
  7382.     by Pascal unless explicitly declared.
  7383.  
  7384.   Availability PasRef is available as part of a separate Apple product,
  7385.   MPW 3.0 Pascal.
  7386.  
  7387.  
  7388.                              See also 
  7389.  
  7390.   Pascal command.
  7391.  
  7392.   MPW 3.0 Pascal Reference.
  7393.  
  7394. æKY Paste
  7395. æC          Paste -- replace selection with Clipboard contents
  7396.  
  7397. Paste [-c count] selection [window]
  7398.  -c count                # repeat the Paste count times
  7399.  
  7400. Status codes returned:
  7401.   0    At least one instance of the selection was found.
  7402.   1    Syntax error.
  7403.   2    Any other error.
  7404.  
  7405.                            Description
  7406.  
  7407.   Finds selection in the specified window and replaces its contents
  7408.   with the contents of the Clipboard. If no window is specified, the
  7409.   command operates on the target window (the second window from the
  7410.   front). It’s an error to specify a window that doesn’t exist.
  7411.  
  7412.   For a definition of selection, see "Selections" in Chapter 6 of the MPW 
  7413.   manual; a summary of the selection syntax is contained in Appendix B.
  7414.  
  7415.  
  7416.                              Examples
  7417.  
  7418.   Paste §
  7419.  
  7420.   Replaces the current selection with the contents of the Clipboard.
  7421.   This command is like the Paste item in the Edit menu, except that
  7422.   the action occurs in the target window.
  7423.  
  7424.   Paste /BEGIN/:/END/
  7425.  
  7426.   Selects everything from the next BEGIN to the following END and replaces
  7427.   the selection with the contents of the Clipboard.
  7428.  
  7429.  
  7430.                              See also 
  7431.  
  7432.   Copy, Cut, and Replace commands.
  7433.  
  7434.   "Edit Menu" in Chapter 3.
  7435.  
  7436.   "Selections" in Chapter 6.
  7437.  
  7438. æKY PerformReport
  7439. æC            PerformReport -- generate a performance report
  7440.  
  7441. PerformReport [option…]  > reportFile ≥ progress
  7442.  -a                      # list all procedures, in segment order
  7443.                          # (default: produce only partial list, sorted by %)
  7444.  -l linkDataFile         # read link map file (concatenated with ROM.list)
  7445.  -m measurementsFile     # read performance measurements file
  7446.                          # (default: "Perform.Out")
  7447.  -n NN                   # show the top NN procedures (default: 50)
  7448.  -p                      # write progress information to diagnostics
  7449.  
  7450. Status codes returned:
  7451.   0    No errors.
  7452.   1    Warning issued.
  7453.   2    Error encountered.
  7454.   3    Heap error;usually insufficient memory.
  7455.  
  7456.                            Description
  7457.  
  7458.   PerformReport reads a link map file and a performance data file and
  7459.   produces a report that relates the performance data to procedure
  7460.   names. The input files are both text files and are distinguished
  7461.   as separate options. For a full discussion of MPW’s performance measurement
  7462.   tools, see Chapter 14 of the MPW manual.
  7463.  
  7464.  
  7465.                              Examples
  7466.  
  7467.   Catenate "{MPW}"ROM.Maps:MacIIROM.map >> myMapFileName
  7468.  
  7469.   PerformReport -l myMapFileName > myReport
  7470.  
  7471.   Adds the ROM map file to the end of the link map file, myMapFileName.
  7472.   Reads the files myMapFileName and Perform.out and writes the output
  7473.   to myReport.
  7474.  
  7475.  
  7476.                              See also 
  7477.  
  7478.   Chapter 14, "Performance-Measurement Tools."
  7479.  
  7480.   MPW 3.0 Pascal Reference.
  7481.  
  7482.   MPW 3.0 C Reference .
  7483.  
  7484. æKY Position
  7485. æC              Position -- display current line position
  7486.  
  7487. Position [-l | -c] [window…]
  7488.  -l                      # only list the line number
  7489.  -c                      # only list the character offsets
  7490.  
  7491. Status codes returned:
  7492.   0    No errors.
  7493.   1    Syntax error.
  7494.   2    Any other error.
  7495.  
  7496.                            Description
  7497.  
  7498.   Position displays the position of the selection in each of the windows
  7499.   specified. If no window is specified, the position of the selection
  7500.   in the Target window is given. By default, the position is displayed
  7501.   as both the line number of the start of the selection and the character
  7502.   positions of the start and end of the selection. The -c option can
  7503.   be used to display only the character positions of the selection.
  7504.   Similarly, the -l option can be used to display only the line number.
  7505.  
  7506.  
  7507.                              Examples
  7508.  
  7509.   Position {Target} file2
  7510.  
  7511.   Displays the position of the selection in both the Target and file2
  7512.   in the following form:
  7513.  
  7514.   578 23129,23140
  7515.  
  7516.   211 8440,8440
  7517.  
  7518.  
  7519.                              See also 
  7520.  
  7521.   Find command.
  7522.  
  7523. æKY Print
  7524. æC                      Print -- print text files
  7525.  
  7526. Print [option…] file…  < file ≥ progress
  7527.  -b                   # print a border around the text
  7528.  -b2                  # alternate form of border
  7529.  -bm n[.n]            # bottom margin in inches (default 0)
  7530.  -c[opies] n          # print n copies
  7531.  -ff string           # treat "string" at beginning of line as a formfeed
  7532.  -f[ont] name         # print using specified font
  7533.  -from n              # begin printing with page n
  7534.  -h                   # print headers (time, file, page)
  7535.  -hf[ont] name        # print headers using specified font
  7536.  -hs[ize] n           # print headers using specified font size
  7537.  -l[ines] n           # print n lines per page
  7538.  -lm n[.n]            # left margin in inches (default .2778)
  7539.  -ls n[.n]            # line spacing (2 means double-space)
  7540.  -md                  # use modification date of file for time in header
  7541.  -n                   # print line numbers to left of text
  7542.  -nw [-]n             # width of line numbers, - indicates zero padding
  7543.  -p                   # write progress information to diagnostics
  7544.  -page n              # number pages beginning with n
  7545.  -ps filename         # include PostScript file as background for each page
  7546.  -q quality           # print quality (HIGH, STANDARD, DRAFT)
  7547.  -r                   # print pages in reverse order
  7548.  -rm n[.n]            # right margin in inches (default 0)
  7549.  -s[ize] n            # print using specified font size
  7550.  -t[abs] n            # consider tabs to be n spaces
  7551.  -title title         # include title in page headers
  7552.  -tm n[.n]            # top margin in inches (default 0)
  7553.  -to n                # stop printing after page n
  7554.  
  7555. Status codes returned:
  7556.   0    Successful completion.
  7557.   1    Parameter or option error.
  7558.   2    Execution error.
  7559.  
  7560.                            Description
  7561.  
  7562.   Prints text files on the currently selected printer. (Printers are
  7563.   selected with the Chooser desk accessory.) One or more files may
  7564.   be printed.
  7565.  
  7566.     • Note: Print does not substitute fonts unless the "Font Substitution"
  7567.     box is checked in the "LaserWriter Page Setup" dialog. To print
  7568.     in a font other than that indicated in the resource fork of the
  7569.     file where the MPW editor stores font information, use the -font
  7570.     option.
  7571.  
  7572.     • Important Print requires the printer drivers available on version
  7573.     1.0 (or later) of the Printer Installation disk.
  7574.  
  7575.  
  7576.                              Examples
  7577.  
  7578.   Print -h -size 8 -ls 0.85 Startup UserStartup
  7579.  
  7580.   Prints the files Startup and UserStartup with page headers, using
  7581.   Monaco 8 and compressing the line spacing.
  7582.  
  7583.   Print -b -hf helvetica -hs 12 -r print.p
  7584.  
  7585.   Prints the "print.p" source file with borders, with headers in Helvetica
  7586.   12, and with pages in reverse order.
  7587.  
  7588.  
  7589.                              See also 
  7590.  
  7591.   Print menu item in "File Menu," Chapter 3.
  7592.  
  7593. æKY ProcNames
  7594. æC        ProcNames -- display Pascal procedure and function names
  7595.  
  7596. ProcNames [option…] [file…]  < file ≥ progress
  7597.     -b                      # display line info for procedure body
  7598.     -c                      # process includes and units only once
  7599.     -cond                   # process $SETC and $IFC, $ELSEC, $ENDC conditionals
  7600.     -d                      # reset total line count to 1 on each new file
  7601.     -d name=TRUE|FALSE      # set $SETC variable name to TRUE or FALSE
  7602.     -e                      # suppress page eject between each procedure listing
  7603.     -f                      # PasMat format compatibility mode
  7604.     -i pathname,…           # search for includes or USES in directory,…
  7605.     -l n                    # process only to max nesting level n
  7606.     -m                      # generate MPW Mark commands for procedure and function declarations
  7607.     -mc68020                # source contains {$IFC OPTION(MC68020)} directives
  7608.     -mc68881                # source contains {$IFC OPTION(MC68881)} directives
  7609.     -n                      # suppress line number and level information
  7610.     -o                      # source file is an Object Pascal program
  7611.     -p                      # write progress information to diagnostics
  7612.     -u                      # process USES declarations
  7613.  
  7614.   Status codes returned:
  7615.      0    Normal termination.
  7616.      1    Parameter or option error.
  7617.  
  7618.                            Description
  7619.  
  7620.   ProcNames is a Pascal utility that accepts a Pascal program or unit
  7621.   as input and produces a listing of all its procedure and function
  7622.   names. The names are shown indented as a function of their nesting
  7623.   level. The nesting level and line-number information is also displayed.
  7624.  
  7625.   ProcNames can be used in conjunction with the Pascal "pretty-printer"
  7626.   PasMat when that utility is used to format separate include files.
  7627.   For that case, PasMat requires that the initial indenting level be
  7628.   specified. This level is exactly the information provided by ProcNames.
  7629.  
  7630.   The line-number information displayed by ProcNames exactly matches
  7631.   that produced by the Pascal cross-reference utility PasRef (with
  7632.   or without USES declarations being processed), so ProcNames can be
  7633.   used in conjunction with the listing produced by PasRef to show just
  7634.   the line numbers of every procedure or function header.
  7635.  
  7636.   Another possible use for the ProcNames output is to use the line-number
  7637.   and file information to find procedures and functions quickly with
  7638.   Shell editing commands.
  7639.  
  7640.  
  7641.                              Examples
  7642.  
  7643.   procnames Memory.p >names
  7644.  
  7645.   Lists all the procedures and functions for the Pascal program Memory.p
  7646.   and writes the output to the file "names". The listing below is the
  7647.   output generated in the "names" file.
  7648.  
  7649.   Procedure/Function names for Memory.p
  7650.  
  7651.    11  11 0 Memory[Main] Memory.p
  7652.    37  37 1 RsrcID
  7653.    43  43 1 DRVROpen
  7654.    63  63 1 DRVRCloseaa
  7655.    74  74 1 DRVRControla
  7656.    76  76 2   DrawWindow
  7657.    83  83 3     PrintNum
  7658.    93  93 3     GetVolStuff
  7659.   108 108 3     PrtRsrcStr
  7660.   168 168 1 DRVRPrime
  7661.   173 173 1 DRVRStatus
  7662.  
  7663.   *** End ProcNames: 11 Procedures and Functions
  7664.  
  7665.   The first two columns on each line are line-number information. The
  7666.   third column is the level number. The first column shows the line
  7667.   number of a routine within the total source. The second column shows
  7668.   the line number within an include file (include files are always
  7669.   processed). As each include file changes, the name of the file from
  7670.   which input is being processed is shown along with the routine name
  7671.   on the first line after the change in source. Segment names (from
  7672.   Pascal compiler $S directives) are similarly processed. These are
  7673.   shown enclosed in square brackets (the blank segment name is shown
  7674.   as "[Main]").
  7675.  
  7676.   Limitations Only syntactically correct programs are accepted by ProcNames.
  7677.   Conditional compilation compiler directives are not processed.
  7678.  
  7679.   Although ProcNames supports $$Shell facility in includes and USES,
  7680.   the processing of MPW’s {PInterfaces} files is not fully supported
  7681.   because these files conditionally include files. Therefore, do not
  7682.   use the -u option.
  7683.  
  7684. æKY Project
  7685. æC             Project -- set or write the current project
  7686.  
  7687. Project [-q | projectName]   > project
  7688.  -q                      # don't quote projects with special characters
  7689.  
  7690. Status codes returned:
  7691.   0    No errors.
  7692.   1    Syntax error.
  7693.   2    Error in processing.
  7694.  
  7695.                            Description
  7696.  
  7697.   Set the current project to projectname or list the current project
  7698.   if projectname is omitted. Projectname must be a mounted project.
  7699.   Refer to the MountProject command for information on how to mount
  7700.   projects.
  7701.  
  7702.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  7703.   symbols used in Projector commands.
  7704.  
  7705. æKY ProjectInfo
  7706. æC          ProjectInfo -- display information about a Project
  7707.  
  7708. ProjectInfo [-project project] [-comments] [-latest] [-f] [-r] [-s] [-only 
  7709.             | -m] [-af author | -a author] [-df dates | -d dates] 
  7710.             [-cf pattern | -c pattern] [-t pattern] [-n name] 
  7711.             [-newer | -update] [file…]
  7712.  -a author         # only list revisions created by author
  7713.  -af author        # only list files created by author
  7714.  -c pattern        # only list revisions whose comment contains pattern
  7715.  -cf pattern       # only list files whose comment contains pattern
  7716.  -comments         # list comments along with the rest of the information
  7717.  -d dates          # only list revisions whose create date is within dates
  7718.  -df dates         # only list files whose mod date is within dates
  7719.  -f                # list file information
  7720.  -log              # print project log
  7721.  -m                # only list files/revisions that are checked out
  7722.  -newer            # info on files that would be checked out using this option
  7723.  -only             # only list project information
  7724.  -project project  # name of project to get information on
  7725.  -r                # recursively list subprojects
  7726.  -latest           # only list info on the latest revision on the main trunk
  7727.  -s                # short listing, names and revision names only
  7728.  -t pattern        # only list revisions whose task contains pattern
  7729.  -n name           # only list revisions that have name
  7730.  -update           # info on files that would be checked out using this option
  7731.  
  7732.  Note: pattern is either a literal string or /regular expression/.
  7733.  
  7734.  Note: "dates" may take the following forms:
  7735.      date                # on date
  7736.      <date               # before but not including date
  7737.      ≤date               # before and including date
  7738.      >date               # after and not including date
  7739.      ≥date               # after and including date
  7740.      date-date           # between and including dates
  7741.      
  7742.  Note:  A date is mm/dd/yy [[hh:mm[:ss]] [AM|PM]]
  7743.  
  7744.  Note: "name" may take the following forms:
  7745.      name                # in name
  7746.      <name               # before name
  7747.      ≤name               # before and including name
  7748.      >name               # after name
  7749.      ≥name               # after and including name
  7750.  
  7751. Status codes returned:
  7752.   0    No errors.
  7753.   1    Syntax error.
  7754.   2    Error in processing.
  7755.   3    System error.
  7756.  
  7757.                            Description
  7758.  
  7759.   By default (with no options specified), ProjectInfo lists information
  7760.   about each revision in every revision tree (file) in the current
  7761.   project. This behavior can be changed using the various options.
  7762.   For example, using the -latest option will display only information
  7763.   about the latest revision on the main trunk of each revision tree.
  7764.   Using the -f option will display information about the revision tree,
  7765.   rather than the particular revisions within that tree. Various other
  7766.   options exist that filter the output such that only the information
  7767.   (typically revisions) that passes through the filter is listed.
  7768.  
  7769.   If object is a project pathname such as Enterprise∫Phaser∫file.c
  7770.   or Enterprise∫Phaser, Projector lists information about every revision
  7771.   of file.c in the Phaser project, or information about every revision
  7772.   tree in the project Enterprise∫Phaser, respectively.
  7773.  
  7774.   If object is a leafname such as file.c, Projector looks in the current
  7775.   project for a revision tree with that name. If found, information
  7776.   about every revision in that revision tree (file.c) is listed. If
  7777.   the file is not a member of the current project, Projector looks
  7778.   for the file in the current directory. If the file exists and is
  7779.   part of a project, then the current state of that file is listed.
  7780.   Projector can determine whether a file belongs to a project because
  7781.   that information is maintained in the resource fork of all checked-out
  7782.   files.
  7783.  
  7784.   Finally, if object is a valid partial or full HFS pathname of a file,
  7785.   and the file is part of a project, then the current state of that
  7786.   file is listed.
  7787.  
  7788.   To list the contents of a specific revision of a file, append a comma
  7789.   followed by the revision number to the filename specified. For example,
  7790.   revision 22 of file.c is specified as file.c,22.
  7791.  
  7792.   You can use the -af, -a, -df, -d, -n, -cf, -c, and -t options to
  7793.   filter (constrain) the information listed to specific authors, dates,
  7794.   names, specific comments, or tasks.
  7795.  
  7796.   Use the -log option to display a log of all changes to the project.
  7797.   These commands are logged: NameRevisions, DeleteRevisions, and DeleteNames.
  7798.  
  7799.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  7800.   symbols used in Projector commands.
  7801.  
  7802.  
  7803.                              Examples
  7804.  
  7805.   In the example below, the current project has three files. The -latest
  7806.   option is used so that only information about the latest revision
  7807.   on the main trunk is listed. The presence of the plus sign (+) indicates
  7808.   that Bob currently has revision 22 of file.c checked out for modification,
  7809.   and that Peter has revision 33 of hdr.c checked out for modification.
  7810.   The date field of these two files reflects the date and time they
  7811.   were checked out. Because no plus sign appears on the line for file.h,
  7812.   it can be checked out for modification. The latest revision of file.h
  7813.   is 17, and the author of the revision is Bob.
  7814.  
  7815.   ProjectInfo -latest
  7816.  
  7817.   Sample∫
  7818.   file.c,22+
  7819.     Owner: Bob
  7820.     Checked out: Fri, Apr 8, 1988, 3:45 PM
  7821.     Task: Fixing bug #223
  7822.  
  7823.   file.h,17
  7824.     Author: Bob
  7825.     Checked in: Mon, Apr 4, 1988, 10:10 AM
  7826.     Task:
  7827.  
  7828.   hdr.c,33+
  7829.     Owner: Peter
  7830.     Checked out: Tue, Apr 12, 1988, 5:58 PM
  7831.     Task: Fixing bug #333
  7832.  
  7833.   Using the -only option causes ProjectInfo to list only information
  7834.   about the project itself.
  7835.  
  7836.   ProjectInfo -only
  7837.  
  7838.   Sample∫
  7839.     Author: Bob
  7840.     Create date: Mon, Apr 4, 1988 8:20 AM
  7841.     Mod date: Thu, Apr 14, 1988, 6:00 PM
  7842.  
  7843.   Use the -f option to list filenames. Note that revision numbers are
  7844.   absent and that the file’s author and last-mod-date are listed. In
  7845.   the example below, file.c and hdr.c are currently checked out.
  7846.  
  7847.   ProjectInfo -f
  7848.  
  7849.   Sample∫
  7850.   file.c
  7851.     Author: Bob
  7852.     Create date: Mon, Apr 4, 1988, 10:00 AM
  7853.     Mod date: Tue, Apr 5, 1988, 2:15 PM
  7854.     Free: No
  7855.  
  7856.   file.h
  7857.     Author: Bob
  7858.     Create date: Mon, Apr 4, 1988, 10:00 AM
  7859.     Mod date: Mon, Apr 4, 1988, 10:00 AM
  7860.     Free: Yes
  7861.  
  7862.   hdr.c
  7863.     Author: Peter
  7864.     Create date: Mon, Apr 4, 1988, 3:30 PM
  7865.     Mod date: Mon, Apr 4, 1988, 6:00 PM
  7866.     Free: No
  7867.  
  7868.   Use the -f and -s options together to output the list of files in
  7869.   the project:
  7870.  
  7871.   ProjectInfo -f -s
  7872.  
  7873.   Sample∫
  7874.   file.c
  7875.   file.h
  7876.   hdr.c
  7877.  
  7878.   The following command will display the entire revision history of
  7879.   file.c. Note that the comment option has been included here as well.
  7880.  
  7881.   ProjectInfo -comments file.c
  7882.  
  7883.   file.c,2+
  7884.     Owner: Bob
  7885.     Checked out: Fri, Apr 8, 1988, 3:45 PM
  7886.     Task: Fixing bug #223
  7887.     Comment: COMMENT…
  7888.  
  7889.   file.c,2
  7890.     Author: Bob
  7891.     Checked in: Thu, Apr 7, 1988, 1:10 PM
  7892.     Task: Fixing bug #222
  7893.     Comment: COMMENT…
  7894.  
  7895.   file.c,1
  7896.     Author: Bob
  7897.     Checked in: Mon, Apr 4, 1988, 9:25 PM
  7898.     Task: Updating procedure comments
  7899.     Comment: COMMENT…
  7900.  
  7901.   Information about HFS files may be displayed by specifying a partial
  7902.   or full HFS pathname. This displays the information in the 'ckid'
  7903.   resource of the file.
  7904.  
  7905.   ProjectInfo :file.c
  7906.  
  7907.   :file.c,22*
  7908.     Owner: Bob
  7909.     Project: Sample∫
  7910.     Checked out: Fri, Apr 8, 1988, 3:45 PM
  7911.     Task: Fixing bug #223
  7912.  
  7913.   The asterisk (*) following the name indicates that the file is a
  7914.   modified read-only file.
  7915.  
  7916.   In the example below, only revisions created by Bob and created on
  7917.   or after April 4, 1988, are displayed.
  7918.  
  7919.   ProjectInfo -a Bob -d
  7920.  
  7921.   Sample∫
  7922.   file.c,22+
  7923.     Owner: Bob
  7924.     Checked out: Fri, Apr 8, 1988, 3:45 PM
  7925.     Task: Fixing bug #223
  7926.  
  7927.   file.c,22
  7928.     Author: Bob
  7929.     Checked in: Thu, Apr 7, 1988, 1:10 PM
  7930.     Task: Fixing bug #222
  7931.  
  7932.   file.c,21
  7933.     Author: Bob
  7934.     Checked in: Mon, Apr 4, 1988, 9:25 PM
  7935.     Task: Updating procedure comments
  7936.  
  7937.   file.h,17
  7938.     Author: Bob
  7939.     Checked in: Mon, Apr 4, 1988, 10:10 AM
  7940.     Task:
  7941.  
  7942.   In the example below, only revisions that have a task dealing with
  7943.   Bug #222 are listed.
  7944.  
  7945.   ProjectInfo -t /bug≈222/
  7946.  
  7947.   Sample∫
  7948.   file.c,22
  7949.     Author: Bob
  7950.     Checked in: Thu, Apr 7, 1988, 1:10 PM
  7951.     Task: Fixing bug #222
  7952.  
  7953.   hdr.c,31
  7954.     Author: Peter
  7955.     Checked in: Fri, Apr 1, 1988, 3:50 PM
  7956.     Task: Bug222 - Adding check procedure
  7957.  
  7958.   The final example demonstrates the -log option.
  7959.  
  7960.   ProjectInfo -log
  7961.  
  7962.   TheShell∫Projector
  7963.     7/5/88 4:07 PM
  7964.       Peter J. Potrebic
  7965.       DeleteNames Work
  7966.     7/2/88 1:37 PM
  7967.       Peter J. Potrebic
  7968.       NameRevisions Work bitmaps.a,2 ckid.c,3a2
  7969.  
  7970.   The log shows that Peter created a public name on July 2 and then
  7971.   deleted it on July 5.
  7972.  
  7973.  
  7974.                              See also 
  7975.  
  7976.   MountProject and UnmountProject.
  7977.  
  7978. æKY Quit
  7979. æC                          Quit -- quit MPW
  7980.  
  7981. Quit [-y | -n | -c]
  7982.  -y                  # save all modified windows (avoids dialog)
  7983.  -n                  # do not save any modified windows (avoids dialog)
  7984.  -c                  # cancel if a window needs to be saved (avoids dialog)
  7985.  
  7986. Status codes returned:
  7987.   1    Syntax error.
  7988.   2    Command aborted.
  7989.        Note: Quit cannot return a status of 0, because if there are no errors 
  7990.        the command never returns.
  7991.  
  7992.                            Description
  7993.  
  7994.   This command is equivalent to the menu command Quit. Quit executes
  7995.   the standard quit procedures, asking confirmation to save modified
  7996.   files, close all windows, and so on.
  7997.  
  7998.  
  7999.                              Examples
  8000.  
  8001.   Quit -y
  8002.  
  8003.   Quits MPW answering "Yes" to any dialogs such as those prompting
  8004.   to save files.
  8005.  
  8006.   Quit -c
  8007.  
  8008.   Quits MPW, unless any confirmation dialogs occur and dialog boxes
  8009.   are displayed.
  8010.  
  8011.  
  8012.                              See also 
  8013.  
  8014.   Shutdown command.
  8015.  
  8016. æKY Quote
  8017. æC             Quote -- echo parameters, quoting if needed
  8018.  
  8019. Quote [-n] [parameter…]   > parameters
  8020.  -n                      # don't write return following the parameters
  8021.  
  8022. Status codes returned:  
  8023.  0  no errors always returned.
  8024.  
  8025.                            Description
  8026.  
  8027.   Quote writes its parameters, separated by spaces and terminated by
  8028.   a return, to standard output. Parameters containing characters that
  8029.   have special meaning to the Shell’s command interpreter are quoted
  8030.   with single quotation marks. If no parameters are specified, only
  8031.   a return is written.
  8032.  
  8033.   Quote is identical to Echo except that Quote quotes parameters that
  8034.   contain special characters. Quote is especially useful when using
  8035.   Shell commands to write a script.
  8036.  
  8037.   The following special characters are quoted:
  8038.  
  8039.   Space Tab Return Null
  8040.  
  8041.   # ; & | ( ) ∂ ' " / \ { } ` ? ≈ [ ] + * « » ® < > ≥ …
  8042.  
  8043.  
  8044.                              Examples
  8045.  
  8046.   Echo ≈.a
  8047.  
  8048.   Quote ≈.a
  8049.  
  8050.   Sample.a Count.a My Program.a
  8051.  
  8052.   Sample.a Count.a 'My Program.a'
  8053.  
  8054.   Echo and Quote behave slightly differently for parameters that contain
  8055.   special characters. The first line above was produced by Echo; the
  8056.   second by Quote.
  8057.  
  8058.   Quote Notice what happens to single quotes: "--'--"
  8059.  
  8060.   Notice what happens to single quotes: '--'''--'
  8061.  
  8062.   Because single quotes can’t appear within single quotes, they are
  8063.   replaced with
  8064.  
  8065.   '' ' which closes the original single quote, adds a literal quote,
  8066.   and reopens the single quotes.
  8067.  
  8068.   For file In ≈.a
  8069.     Quote Print "{file}"
  8070.   End
  8071.   Print Sample.a
  8072.   Print Count.a
  8073.   Print 'My Program.a'
  8074.  
  8075.   The For loop shown above writes a Print command for each file that
  8076.   matches the pattern ≈.a. These commands can then be selected and
  8077.   executed. Notice the quotation marks in the last Print command.
  8078.  
  8079.  
  8080.                              See also 
  8081.  
  8082.   Echo and Parameters commands.
  8083.  
  8084. æKY Rename
  8085. æC               Rename -- rename files and directories
  8086.  
  8087. Rename [-y | -n | -c] oldName newName
  8088.  -y                      # overwrite existing file (avoids dialog)
  8089.  -n                      # don't overwrite existing file (avoids dialog)
  8090.  -c                      # cancel if conflict occurs (avoids dialog)
  8091.  
  8092. Status codes returned:
  8093.   0    Successful rename.
  8094.   1    Syntax error.
  8095.   2    Name does not exist.
  8096.   3    An error occurred.
  8097.   4    Cancel was selected or implied by the -c option.
  8098.  
  8099.                            Description
  8100.  
  8101.   The file, folder or disk specified by name is renamed newName. A
  8102.   dialog box requests a confirmation if the rename would overwrite
  8103.   an existing file or folder. The -y, -n, or -c options can be used
  8104.   to avoid this interaction.
  8105.  
  8106.     • Note: You can’t use the Rename command to change the directory
  8107.     a file is in. To do this, use the Move command.
  8108.  
  8109.     • Note also: Wildcard renames in the following form will not
  8110.     work:
  8111.  
  8112.   Rename ≈.text ≈.p
  8113.  
  8114.   This is because the Shell expands the filename patterns "≈.text"
  8115.   and "≈.p" before invoking the Rename command. In order to gain the
  8116.   desired effect, you would need to execute a command such as the one
  8117.   shown in the fifth example below.
  8118.  
  8119.  
  8120.                              Examples
  8121.  
  8122.   Rename File1 File2
  8123.  
  8124.   Changes the name of File1 to File2.
  8125.  
  8126.   Rename HD:Programs:Prog.c Prog.Backup.c
  8127.  
  8128.   Changes the name of Prog.c in the directory HD:Programs to Prog.Backup.c
  8129.   in the same directory.
  8130.  
  8131.   Rename Untitled: Backup:
  8132.  
  8133.   Changes the name of the disk Untitled to Backup.
  8134.  
  8135.   Rename -c File1 File2
  8136.  
  8137.   Changes the name of File1 to that of File2; if a conflict occurs,
  8138.   it cancels the operation and returns a status of 4.
  8139.  
  8140.   To perform a wildcard rename, you could execute the following set
  8141.   of commands:
  8142.  
  8143.   For Name In ≈.text
  8144.     ( Evaluate {Name} =~ /(≈)®1.text/ ) > Dev:Null
  8145.     Rename {Name} {®1}.p
  8146.   End
  8147.  
  8148.   The Evaluate command is executed only for its side effect of permitting
  8149.   regular expression processing. (The expression operator =~ indicates
  8150.   that the right side of the expression is a regular expression.) Thus,
  8151.   you can use the regular expression capture mechanism, (regularExpr)®n.
  8152.   Evaluate’s output is tossed in the bit bucket (Dev:Null).
  8153.  
  8154.  
  8155.                              See also 
  8156.  
  8157.   Move command.
  8158.  
  8159. æKY Replace
  8160. æC                   Replace -- replace the selection
  8161.  
  8162. Replace [-c count] selection replacement [window]
  8163.  -c count                # repeat the replace count times
  8164.  
  8165. Status codes returned:
  8166.   0    At least one instance of the selection was found.
  8167.   1    Syntax error.
  8168.   2    Any other error.
  8169.  
  8170.                            Description
  8171.  
  8172.   Replace finds selection in the specified window and replaces it with
  8173.   replacement. If no window is specified, the command operates on the
  8174.   target window (the second window from the front). It’s an error to
  8175.   specify a window that doesn’t exist. If a count is specified, the
  8176.   Replace command is repeated count times.
  8177.  
  8178.   For a definition of selection, see "Selections" in Chapter 6 of the MPW
  8179.   manual. A summary of the selection syntax is contained in Appendix B.
  8180.  
  8181.   You can include references to parts of the selection in the replacement
  8182.   by using the ® operator. The expression ®n, where n is a digit, is
  8183.   replaced with the string of characters that matches the regular expression
  8184.   tagged by ®n in the selection. (See "Tagging Regular Expressions
  8185.   With the ® Operator" in Chapter 6.)
  8186.  
  8187.   The selection is a selection expression while replacement is a string
  8188.   (that could contain the ® operator). If replacement contains spaces
  8189.   or special characters, enclose it in quotation marks.
  8190.  
  8191.   All searches are by default not case sensitive. To specify case-sensitive
  8192.   matching, set the {CaseSensitive} variable before executing the command.
  8193.  
  8194.  
  8195.                              Examples
  8196.  
  8197.   Replace -c ∞ /myVar/ 'myVariable' Prog.p
  8198.  
  8199.   Replaces every subsequent instance of the selection with the string
  8200.   in single quotation marks.
  8201.  
  8202.   Replace -c 5 /•[ ]+/ ''
  8203.  
  8204.   Strips off all the spaces and tabs at the front of the next five
  8205.   lines in the file (and replaces them with the null string). This
  8206.   action takes place in the target window.
  8207.  
  8208.   Set HexNum "[0-9A-F]+"
  8209.   Set Spaces "[ ]+"
  8210.   Replace -c ∞ /({HexNum})®1{Spaces}({HexNum})®2/ ®1 ®2
  8211.  
  8212.   Defines two variables for use in the subsequent Replace command,
  8213.   and converts a file that contains two columns of hex digits (such
  8214.   as the icon list from ResEdit) into a single column of hex digits.
  8215.  
  8216.  
  8217.                              See also 
  8218.  
  8219.   Find and Clear commands.
  8220.  
  8221.   Chapter 6.
  8222.  
  8223.   Appendix B.
  8224.  
  8225. æKY Request
  8226. æC              Request -- request text from a dialog box
  8227.  
  8228. Request [-q] [-d default] [message…] < file 
  8229.  -q                      # don't set status if user selects cancel
  8230.  -d default              # set default response
  8231.  
  8232. Status codes returned:
  8233.   0    The OK button was selected.
  8234.   1    Syntax errors.
  8235.   4    The Cancel button was selected.
  8236.  
  8237.                            Description
  8238.  
  8239.   Request displays an editable text dialog box with OK and Cancel buttons
  8240.   and the prompt message. If you select the OK button, any text you
  8241.   type into the dialog box is written to standard output. The -d option
  8242.   lets you set a default response to the request.
  8243.  
  8244.  
  8245.                              Examples
  8246.  
  8247.   Set Exit 0
  8248.   Set FileName "`Request 'File to compile' -d "{Active}"`"
  8249.   If {FileName} ≠ ""
  8250.     Pascal "{FileName}" ≥≥ "{WorkSheet}"
  8251.   End
  8252.   Set Exit 1
  8253.  
  8254.   Displays a dialog box that lets the user enter the name of a file
  8255.   to be compiled. Sets the default to be the name of the active window,
  8256.   as follows:
  8257.  
  8258. æKY ResEqual
  8259. æC           ResEqual -- compares the resources in two files
  8260.  
  8261. ResEqual [-p] File1 File2
  8262.  -p                      # write progress information to diagnostics
  8263.  
  8264. Status codes returned:
  8265.   0    Resources match.
  8266.   1    Parameter or option error.
  8267.   2    Files don’t match.
  8268.  
  8269.                            Description
  8270.  
  8271.   ResEqual compares the resources in two files and writes their differences
  8272.   to standard output.
  8273.  
  8274.   ResEqual checks that each file contains resources of the same type
  8275.   and identifier as the other file; that the size of the resources
  8276.   with the same type and identifier are the same; and that their contents
  8277.   are the same.
  8278.  
  8279.  
  8280.                              Examples
  8281.  
  8282.   Resequal Sample Sample.rsrc
  8283.  
  8284.   Compares the resources in Sample and Sample.rsrc, writing the results
  8285.   to standard output.
  8286.  
  8287.   Limitations When the contents of resources are compared and a mismatch
  8288.   is found, the mismatch and the subsequent 15 bytes are written. ResEqual
  8289.   then continues the comparison, starting with the byte following the
  8290.   last displayed.
  8291.  
  8292.   If more than ten differences are detected in the same resource, the
  8293.   rest of the resource is skipped and processing continues with the
  8294.   next resource.
  8295.  
  8296.  
  8297.                              See also 
  8298.  
  8299.   Equal command. (The -r option of Equal compares the resource forks
  8300.   of files on a byte-by-byte basis, including the resource map.)
  8301.  
  8302.  
  8303. æKY Revert
  8304. æC           Revert -- revert window to previous saved state
  8305.  
  8306. Revert [-y] [window…]
  8307.  -y                      # revert to old version (without dialog)
  8308.  
  8309. Status codes returned:
  8310.   0    No errors.
  8311.   1    Parameter or option error.
  8312.   2    The specified window does not exist.
  8313.   3    A system error occurred.
  8314.   4    The Cancel button was selected.
  8315.  
  8316.                            Description
  8317.  
  8318.   Reverts the specified windows to their previously saved states. If
  8319.   no window is specified, Revert works on the target window. Revert
  8320.   displays a confirmation dialog box, but you can avoid this dialog
  8321.   box by using the -y option to revert unconditionally to the last
  8322.   saved version of the document.
  8323.  
  8324.  
  8325.                              Examples
  8326.  
  8327.   Revert
  8328.  
  8329.   Displays a confirmation dialog box for reverting the target window
  8330.   to its last saved state.
  8331.  
  8332.   Revert -y {Worksheet}
  8333.  
  8334.   Reverts unconditionally to last saved worksheet.
  8335.  
  8336.  
  8337.                              See also 
  8338.  
  8339.   Close and Save commands.
  8340.  
  8341. æKY Rez
  8342. æC                       Rez -- resource compiler
  8343.  
  8344. Rez [option…] [file…]  < file ≥ progress
  8345.     -a[ppend]               # merge resource into output resource file
  8346.     -align word | longword  # align resource to word or longword boundries
  8347.     -c[reator] creator      # set output file creator
  8348.     -d[efine] name[=value]  # equivalent to: #define macro [value]
  8349.     -i[nclude] pathname     # path to search when looking for  #include files
  8350.     -m[odification]         # don't change the output file's modification date
  8351.     -o file                 # write output to file (default Rez.Out)
  8352.     -ov                     # ok to overwrite protected resources when appending
  8353.     -p                      # write progress information to diagnostics
  8354.     -rd                     # suppress warnings for redeclared types
  8355.     -ro                     # set the mapReadOnly flag in output
  8356.     -s[earch] pathname      # path to search when looking for INCLUDE resources
  8357.     -t[ype] type            # set output file type
  8358.     -u[ndef] name           # equivalent to: #undef name
  8359.  
  8360. Status codes returned:
  8361.   0    No errors.
  8362.   1    Error in parameters.
  8363.   2    Syntax error in file.
  8364.   3    I/O or program error.
  8365.  
  8366.                            Description
  8367.  
  8368.   Rez compiles the resource fork of a file according to a textual description.
  8369.   The resource description file is a text file that has the same format
  8370.   as the output produced by DeRez, the resource decompiler. The data
  8371.   used to build the resource file can come directly from the resource
  8372.   description file(s) as well as from other text files (via #include
  8373.   and read directives in the resource description file) and from other
  8374.   resource files (via the include directive).
  8375.  
  8376.   Rez includes macro processing, full expression evaluation, and built-in
  8377.   functions and system variables. For information about Rez and the
  8378.   format of a resource description file, see Chapter 11 of the MPW manual. 
  8379.   For a summary of the format of a resource description file, see Appendix D.
  8380.  
  8381.  
  8382.                              Examples
  8383.  
  8384.   Rez Types.r Sample.r -o Sample
  8385.  
  8386.   Generates a resource fork for the file Sample, based on the descriptions
  8387.   in Types.r and Sample.r.
  8388.  
  8389.  
  8390.                              See also 
  8391.  
  8392.   DeRez and RezDet commands.
  8393.  
  8394.   Chapter 11 and Appendix D.
  8395.  
  8396.   Standard resource type declarations in the directory {RIncludes}:
  8397.  
  8398.     • Types.r
  8399.  
  8400.     • SysTypes.r
  8401.  
  8402.     • MPWTypes.r
  8403.  
  8404.     • Pict.r
  8405.  
  8406. æKY RezDet
  8407. æC            RezDet -- detect inconsistencies in resources
  8408.  
  8409. RezDet [option…] file…   > dump
  8410.  -b[ig]                  # read resources one at a time, not all at once
  8411.  -d[ump]                 # write -show information, plus headers, lists, etc.
  8412.  -l[ist]                 # write list of resources with minimum information
  8413.  -q[uiet]                # don't write any output, just set {Status}
  8414.  -r[awdump]              # write -dump information plus contents
  8415.  -s[how]                 # write information about each resource
  8416.  
  8417.  Note: Use at most one of -quiet, -list, -show, -dump, and -rawdump.
  8418.  
  8419. Status codes returned:
  8420.   0    No errors detected.
  8421.   1    Invalid options or no files specified.
  8422.   2    Resource format error detected.
  8423.   3    Fatal error—an I/O or program error was detected.
  8424.  
  8425.                            Description
  8426.  
  8427.   If no options are specified, RezDet investigates the resource fork
  8428.   of each file for damage or inconsistencies. The specified files are
  8429.   read and checked one by one. Output is generated according to the
  8430.   options specified.
  8431.  
  8432.   RezDet checks for the following conditions:
  8433.  
  8434.     • The resource fork is at least the minimum size. (There must
  8435.     be enough bytes to read a resource header.)
  8436.  
  8437.     • There is no overlap or space between the header, the resource
  8438.     data list, and the resource map. There should be no bytes between
  8439.     the EOF and the end of the resource map.
  8440.  
  8441.     • Each record in the resource data list is used once and only
  8442.     once. The last data item ends exactly where the data list ends.
  8443.  
  8444.     • Each item in the resource type list contains at least one reference;
  8445.     each sequence of referenced items starts where the previous resource
  8446.     type item’s reference list ended; and each item in the reference
  8447.     list is pointed to by one and only one resource type list item.
  8448.  
  8449.     • There are no duplicates in the resource type list.
  8450.  
  8451.     • Each name in the name list has one and only one reference,
  8452.     and the last name doesn’t point outside the name list.
  8453.  
  8454.     • There are no duplicate names in the name list. Duplicate names
  8455.     cause an advisory warning rather than a true error. This warning
  8456.     is given only if the -s, -d, or -r option is selected.
  8457.  
  8458.     • Each reference list item points to a valid data item and either
  8459.     has a name list offset of –1 or points to a valid name list offset.
  8460.  
  8461.     • Bits 7 (Unused), 1 (Changed), or 0 (Unused) should not be set
  8462.     in the resource attributes.
  8463.  
  8464.     • All names have a nonzero length.
  8465.  
  8466.   Fields are displayed as hexadecimal or decimal for numeric values,
  8467.   or as a hex dump with associated printable Macintosh characters.
  8468.   The characters newline ($0D), tab ($09) and null ($00) are displayed
  8469.   as "¬", "Δ", and ".", respectively.
  8470.  
  8471.     • Note: RezDet does not use the Resource Manager and should not
  8472.     crash, no matter how corrupt the resource fork of the file.
  8473.  
  8474.  
  8475.                              Examples
  8476.  
  8477.   RezDet {SystemFolder}System
  8478.  
  8479.   Checks the System file for damage.
  8480.  
  8481.   RezDet -q Foo || Delete Foo
  8482.  
  8483.   Removes the file Foo if the resource fork is damaged.
  8484.  
  8485.   Limitations Duplicate resource name warnings are generated even if
  8486.   the names belong to resources of different types.
  8487.  
  8488.   The file attributes field in the resource map header is not validated.
  8489.  
  8490.   The Finder-specific fields in the header and resource map header
  8491.   are ignored.
  8492.  
  8493. æKY RotateWindows
  8494. æC       RotateWindows -- send active (frontmost) window to back
  8495.  
  8496. RotateWindows [-r]
  8497.  -r                      # reverse rotation; bring bottom window to front
  8498.  
  8499. Status codes returned:
  8500.   0    No errors.
  8501.   1    Syntax error (error in parameters).
  8502.  
  8503.                            Description
  8504.  
  8505.   RotateWindows places the front MPW window in the back and brings
  8506.   the second window to the front. Multiple calls to RotateWindows rotate
  8507.   through all open MPW windows. RotateWindows brings only MPW windows
  8508.   to the front (desk accessory windows are not rotated). You might
  8509.   want to add this command to a menu, along with a command key equivalent.
  8510.   For example:
  8511.  
  8512.   AddMenu 'Extras' 'RotateWindows/®' 'RotateWindows'
  8513.  
  8514.  
  8515.                              Examples
  8516.  
  8517.   RotateWindows
  8518.  
  8519.   Puts the front MPW window in back, and brings the target MPW window
  8520.   to the front.
  8521.  
  8522.  
  8523.                              See also 
  8524.  
  8525.   StackWindows, SizeWindow, MoveWindow, and ZoomWindow commands.
  8526.  
  8527. æKY Save
  8528. æC                    Save -- save specified windows
  8529.  
  8530. Save [-a | window…]
  8531.  -a                      # save the contents of all windows
  8532.  
  8533. Status codes returned:
  8534.   0    No errors.
  8535.   1    Syntax error.
  8536.   2    Specified window does not exist.
  8537.  
  8538.                            Description
  8539.  
  8540.   Saves the contents of window or a list of windows to disk without
  8541.   closing them. The -a option saves all open windows. Save without
  8542.   any parameters saves the target window (the second window from the
  8543.   front).
  8544.  
  8545.  
  8546.                              Examples
  8547.  
  8548.   Save -a
  8549.  
  8550.   Saves all open windows.
  8551.  
  8552.   Save {Active} {Worksheet}
  8553.  
  8554.   Saves the Worksheet window and the contents of the active window.
  8555.  
  8556.  
  8557.                              See also 
  8558.  
  8559.   Close and Revert commands.
  8560.       
  8561. æKY SaveOnClose
  8562. æC                    SaveOnClose -- set save behavior when closing windows
  8563.  
  8564. SaveOnClose [-a | -d | -n] [window…]
  8565.  -a                  # always save upon close ("Close -y")
  8566.  -d                  # default behavior for Close
  8567.  -n                  # never save upon close ("Close -n")
  8568.  
  8569.                            Description
  8570.                                                                                  
  8571. This command selects an automatic behavior: save, do not save, or ask
  8572. whether to save when closing a window.  The -n option does not turn off 
  8573. the Save menu item, allowing the user to request saving explicitly. 
  8574.                                                                            
  8575.  
  8576. æKY Search
  8577. æC                  Search -- search files for pattern
  8578.  
  8579. Search [-b] [-s | -i] [-nf] [-r] [-q] [-f file] pattern [file…] < file > found
  8580.  -b                 # break "File/Line" from matched pattern
  8581.  -i                 # case insensitive search (overriding {CaseSensitive})
  8582.  -s                 # case sensitive search (overriding {CaseSensitive})
  8583.  -nf                # write "pattern not found" to standard error and set status = 2
  8584.  -ns                # return 0 when pattern not found
  8585.  -q                 # suppress file name and line number in output
  8586.  -r                 # write non-matching line to standard output
  8587.  -sf                # stop at first match
  8588.  -f file            # lines not written to output are put in this file
  8589.  
  8590. Status codes returned:
  8591.   0    No error.
  8592.   1    Syntax error.
  8593.   2    Pattern not found.
  8594.  
  8595.                            Description
  8596.  
  8597.   Searches the input files for lines that contain a pattern and writes
  8598.   those lines to standard output. If no file is given, standard input
  8599.   is searched. When reading from files, the filenames and line numbers
  8600.   of matching lines are prepended to each line of output.
  8601.  
  8602.   Pattern (defined in "Pattern Matching" in Chapter 6 of the MPW manual and 
  8603.   in Appendix B) is a regular expression, optionally enclosed in forward 
  8604.   slashes ( / ).
  8605.  
  8606.  
  8607.                              Examples
  8608.  
  8609.   Search /procedure/ Sample.p
  8610.  
  8611.   Searches the file Sample.p for the pattern "procedure". All lines
  8612.   containing this pattern are written to standard output.
  8613.  
  8614.   Search /Export/ {MPW}StartUp {MPW}UserStartUp
  8615.  
  8616.   Lists the Export commands in the StartUp and UserStartup files.
  8617.  
  8618.   Search /PROCEDURE [a-zA-Z0-9_]*;/ {PInterfaces}≈
  8619.  
  8620.   Searches for the procedures with no parameters in the Pascal interface
  8621.   files supplied with MPW Pascal. Because more than one input file
  8622.   is specified, a filename will precede each line in the output.
  8623.  
  8624.   Search -f file.nonmatch /pattern/ file
  8625.  
  8626.   All lines of "file" that contain "pattern" are written to standard
  8627.   output. All other lines will be placed in file.nonmatch. This, in
  8628.   effect, splits the file in two pieces, using "pattern" as the key.
  8629.  
  8630.   Search -r -f file.nonmatch /pattern/ file
  8631.  
  8632.   This does the opposite of the preceding example. All lines that do
  8633.   not contain "pattern" are echoed to standard output, and all other
  8634.   lines (that is, those containing "pattern") are written to file.nonmatch.
  8635.  
  8636.  
  8637.                              See also 
  8638.  
  8639.   Find command.
  8640.  
  8641.   "Pattern Matching (Using Regular Expressions)" in Chapter 6.
  8642.  
  8643. æKY Set
  8644. æC               Set -- define or write Shell variables
  8645.  
  8646. Set [name [value]]   > variableList
  8647.  
  8648. Status codes returned:
  8649.   0    No error.
  8650.   1    Syntax error.
  8651.   2    Variable "name" does not exist.
  8652.  
  8653.                            Description
  8654.  
  8655.   Set assigns the string value to the variable name. If value is omitted,
  8656.   Set writes the name and its current value to standard output. If
  8657.   both name and value are omitted, Set writes a list of all variables
  8658.   and their values to standard output. (This output is in the form
  8659.   of Set commands.)
  8660.  
  8661.     • Note: To make variable definitions available to enclosed scripts
  8662.     and programs, you must use the Export command.
  8663.  
  8664.  
  8665.                              Examples
  8666.  
  8667.   Set CIncludes "{MPW}CFiles:CIncludes:"
  8668.  
  8669.   Redefines the variable CIncludes.
  8670.  
  8671.   Set CIncludes
  8672.  
  8673.   Displays the new definition of CIncludes.
  8674.  
  8675.   Set Commands ∂
  8676.   ":,{MPW}Tools:,{MPW}Applications:,{MPW}ShellScripts:"
  8677.  
  8678.   Redefines the variable {Commands} to include the directory "{MPW}ShellScripts:".
  8679.   (See Chapter 5 for a complete list of predefined variables.)
  8680.  
  8681.   Set > SavedVariables
  8682.   # ... other commands
  8683.   Execute SavedVariables
  8684.  
  8685.   Writes the values of all variables to file SavedVariables. Because
  8686.   the output of Set is actually Set commands, the file can be executed
  8687.   later to restore the saved variable definitions. This technique is
  8688.   used in the Suspend and Resume scripts to save and restore variable
  8689.   definitions, as well as exports, aliases, and menus.
  8690.  
  8691.  
  8692.                              See also 
  8693.  
  8694.   Export, Unexport, and Unset commands.
  8695.  
  8696.   "Defining and Redefining Variables" in Chapter 5.
  8697.  
  8698.   "The Startup and UserStartup Files" in Chapter 5.
  8699.  
  8700. æKY SetDirectory
  8701. æC             SetDirectory -- set the default directory
  8702.  
  8703. SetDirectory directory
  8704.  
  8705. Status codes returned:
  8706.   0    Successful completion.
  8707.   1    Parameter error or unable to set directory.
  8708.  
  8709.                            Description
  8710.  
  8711.   SetDirectory sets the default directory and adds the new default
  8712.   directory to the Directory menu if it is not already present. The
  8713.   directory parameter must be specified.
  8714.  
  8715.     • Note: Directory names should not contain any of the special
  8716.     characters shown below. These characters all have special meaning
  8717.     when they appear in menu items:
  8718.  
  8719.   - ; ^ ! < / (
  8720.  
  8721.   The SetDirectory script is used to implement the Set Directory menu
  8722.   item in the Directory menu.
  8723.  
  8724.  
  8725.                              Examples
  8726.  
  8727.   SetDirectory {MPW}Scripts:
  8728.  
  8729.   Sets the default directory to the Scripts folder in the {MPW} directory
  8730.   and adds {MPW}Scripts: to the Directory menu if it’s not already
  8731.   there.
  8732.  
  8733.   SetDirectory…
  8734.  
  8735.   Uses the Commando dialog box to select the default directory interactively.
  8736.  
  8737.  
  8738.                              See also 
  8739.  
  8740.   Directory, DirectoryMenu, and Files commands.
  8741.  
  8742. æKY SetFile
  8743. æC                   SetFile -- set file/folder attributes
  8744.  
  8745. SetFile [option…] file/folder…
  8746.  -a attributes         # attributes (lowercase = 0, uppercase = 1)
  8747.  -c creator            # file creator
  8748.  -d date               # creation date (mm/dd/yy [hh:mm[:ss] [AM | PM]])*
  8749.  -l h,v                # ICON location (horizontal,vertical)*
  8750.  -m date               # modification date (mm/dd/yy [hh:mm[:ss] [AM | PM]])*
  8751.  -t type               # file type
  8752.  
  8753.  Note: Period (.) represents the current date and time.
  8754.  Note: The following attributes may be used with the -a option:
  8755.      L   Locked
  8756.      V   Invisible*
  8757.      B   Bundle
  8758.      S   System
  8759.      I   Inited*
  8760.      D   Desktop*
  8761.      M   Shared (can run multiple times)
  8762.      A   Always switch launch (if possible)
  8763. *Note: Options/attributes marked with an asterisk (*) are allowed with folders
  8764.  
  8765. Status codes returned:
  8766.   0    The attributes for all files were set.
  8767.   1    Syntax error.
  8768.   2    An error occurred.
  8769.       
  8770.  
  8771.                            Description
  8772.  
  8773.   Sets attributes for one or more files. The options apply to all files
  8774.   listed.
  8775.  
  8776.  
  8777.                              Examples
  8778.  
  8779.   SetFile -c "MPS " -t MPST ResEqual
  8780.  
  8781.   Sets the creator and type for the MPW Pascal tool ResEqual.
  8782.  
  8783.   SetFile Foo -m "2/15/86 2:25"
  8784.  
  8785.   Sets the modification date of file Foo.
  8786.  
  8787.   SetFile Foo Bar -m .
  8788.  
  8789.   Sets the modification date to the current date and time (the period
  8790.   is a parameter to -m, indicating current date and time). Setting
  8791.   the date is useful, for instance, before running Make.
  8792.  
  8793.  
  8794.                              See also 
  8795.  
  8796.   Files command. (The -l and -x options display file information.)
  8797.  
  8798. æKY SetPrivilege
  8799. æC  SetPrivilege -- set access privileges for directories on file servers
  8800.  
  8801. SetPrivilege [option…] directory…  > information
  8802.     -d privileges           # set privileges for seeing directories
  8803.     -f privileges           # set privileges for seeing files
  8804.     -g group                # make the directories belong to group
  8805.     -i                      # return information on directories
  8806.     -m privileges           # set privileges for making changes
  8807.     -o owner                # make owner the owner of directories
  8808.     -r                      # operate (set or list) recursively
  8809.  
  8810.     Note: The following privilege characters may be used with
  8811.     the -d, -f, or -m options (Upper case enables the privilege,
  8812.     lower case disables it):
  8813.          O   Owner
  8814.          G   Group
  8815.          E   Everyone
  8816.  
  8817. Status codes returned:
  8818.   0    No error.
  8819.   1    Syntax error.
  8820.   2    Folder not found, or folder not an AppleShare folder.
  8821.   3    User is not owner; could not modify privileges.
  8822.  
  8823.                            Description
  8824.  
  8825.   Using SetPrivilege is equivalent to using the access privileges desk
  8826.   accessory. Priv is a character string (one, two or three characters
  8827.   long) that specifies privileges for the owner, the group, and everyone
  8828.   (o, g, and e, respectively). An uppercase letter enables the privilege;
  8829.   a lowercase letter disables the privilege. If a specific character
  8830.   is not in the string, the respective privilege is not changed.
  8831.  
  8832.  
  8833.                              Examples
  8834.  
  8835.   SetPrivilege -r -f OGe -d OGe -m Oge ∂
  8836.   "Server:personal:peter"
  8837.  
  8838.   This gives everyone in your group the ability to see files within
  8839.   Server:personal:peter without being able to change them. Anyone outside
  8840.   the group cannot see the files or folders or make changes. The owner
  8841.   can do everything.
  8842.  
  8843.   Here is the easiest way to use the SetPrivilege command: Use the
  8844.   -i option to get information on folders and edit the privileges as
  8845.   desired. Then execute the resulting command. For example, to change
  8846.   the privileges for Server:Private, follow these steps:
  8847.  
  8848.   1. Execute this command to obtain the current privileges:
  8849.  
  8850.   SetPrivilege -i Server:Private
  8851.  
  8852.   SetPrivilege Server:Private -o Joe -g Team -d OGE -f OGE -m OGE
  8853.  
  8854.     • Note: These privileges show that Joe, the group Team, and everyone
  8855.     else has all privileges to the folder Private.
  8856.  
  8857.   2. Now edit the output, adjusting the privileges as desired. For
  8858.   example,
  8859.  
  8860.   SetPrivilege Server:Private -o Joe -g Team -d Oge -f Oge -m Oge
  8861.  
  8862.     • Note: Now only Joe, the owner, can see directories and files.
  8863.     Only Joe can make changes; all other users have no privileges.
  8864.  
  8865.   3. Execute the resulting command.
  8866.  
  8867. æKY SetVersion
  8868. æC          SetVersion -- maintain version and revision number
  8869.  
  8870. SetVersion [option…] file  > output ≥ progress
  8871.  -b                    # increment the bug fix component by 1
  8872.  -country name         # country code name
  8873.  -csource file         # update the #define Version string in C source
  8874.  -d                    # display (updated) version numbers to standard output
  8875.  -fmt nƒ.mƒ            # format version numbers according to specification
  8876.  -i resid              # use specified resource id instead of 0
  8877.  -p                    # write SetVersion's version info to diagnostic file
  8878.  -prefix prefix        # prefix version with specified prefix
  8879.  -[p]source file       # update the Version string constant in Pascal source
  8880.  -r                    # increment the revision component by 1
  8881.  -rezsource file       # update the resource definition in Rez source
  8882.  -sb bugfix            # set the bug fix component to the specified value
  8883.  -sr revision          # set the revision component to the specified value
  8884.  -stage stage          # set release stage for a 'vers' resource
  8885.  -suffix suffix        # suffix the version with specified suffix
  8886.  -sv version           # set the version component to the specified value
  8887.  -sx nonrel            # set the non-release component to the specified value
  8888.  -sync 1 | 2           # synchronize 'vers',1 with 'vers',2 or vice versa
  8889.  -t type               # use specified resource type
  8890.  -v                    # increment the version component by 1
  8891.  -verid identifier     # use C/Pascal source version id instead of "Version"
  8892.  -version fmtstring    # alternate way of specifying version component actions
  8893.  -verstring longstring # set the long version string of a Finder 'vers' resource
  8894.  -x                    # increment the non-release component by 1
  8895.  
  8896. Status codes returned:
  8897.   0    Normal termination.
  8898.   1    Parameter or option error.
  8899.  
  8900.                            Description
  8901.  
  8902.   SetVersion generates and maintains (sets or increments) the individual
  8903.   components making up a version number for a file. There are two forms
  8904.   of version numbering supported by SetVersion:
  8905.  
  8906.   ver.rev The first version numbering form is "ver.rev", where ver
  8907.   is a version number and rev a revision number. The component values
  8908.   are kept in a private resource generated and maintained by SetVersion
  8909.   itself. The resource is generally used only by applications (for
  8910.   example, in their About box) and MPW tools (for example, when an
  8911.   MPW tool’s -p option is used) that contain code to read the resource.
  8912.   It is also recognized by Commando to be displayed just below the
  8913.   Do It button of a Commando dialog box1.
  8914.  
  8915.   In this form of version numbering, the resource is maintained as
  8916.   a Pascal string with the resource type 'MPST' and a resource ID of
  8917.   0 (you can use the -t and -i options to specify another resource
  8918.   type and ID number if desired). The resource has the following layout
  8919.   (described as Rez input):
  8920.  
  8921.  
  8922.                              Examples
  8923.  
  8924.   setversion -d -sv 1 -r Example -psource Globals -rezsource Example.r
  8925.  
  8926.   The MPW tool Example contains a SetVersion 'MPST' string resource.
  8927.   The above command line increments the revision for the tool (-r)
  8928.   in the resource fork of the file Example. The version is fixed at
  8929.   1 (-sv), so that Example displays the version and revision as "1.rev".
  8930.   The Pascal include file, Globals, contains the tool’s global declarations,
  8931.   including the Version string. This include file is updated to match
  8932.   the 'MPST' resource (-psource). The resource definitions for the
  8933.   tools, in Example.r, will be similarly updated (-rezsource). Finally,
  8934.   this command displays the new version of the standard output file
  8935.   (-d).
  8936.  
  8937.   setversion -d -version 1.Δ Example -psource Globals -rezsource Example.r
  8938.  
  8939.   Same as previous example, but here we illustrate how the -version
  8940.   option serves the same purpose as the -sv and -r options. Here the
  8941.   "Δ" indicates that the revision is to be incremented.
  8942.  
  8943.   setversion -d -version 1.2.%bΔ Example -psource Globals ∂
  8944.   -rezsource Example.r
  8945.  
  8946.   Again an 'MPST' SetVersion string resource is to be generated. But
  8947.   here we use a more complex version number. The version is set to
  8948.   1, the revision to 2, the bug fix level is left alone ("%"), this
  8949.   is a beta (b) release, and finally the nonrelease level is to be
  8950.   incremented.
  8951.  
  8952.   SetVersion SetVersion -psource SetVersion.p -version 3.Δ -t vers -i 1 ∂
  8953.   -d -verstring "^, ©Apple Computer, Inc. 1984-1988, by Ira L. Ruben"
  8954.  
  8955.   SetVersion SetVersion -version 3.0b1 -t vers -i 2 -verstring "MPW
  8956.   3.0b1"
  8957.  
  8958.   This pair of SetVersion commands generates both Finder 'vers',1 and
  8959.   'vers',2 resources. The Finder Get Info display shown earlier illustrates
  8960.   the result of using these commands. The MPW tool, SetVersion, has
  8961.   its own version number, 3.Δ (the revision is incremented for version
  8962.   3) set as a 'vers',1 resource (-t 'vers', -i 1). A long version message
  8963.   is specified by the -verstring option. The version number from the
  8964.   short message string is inserted into the long string at the position
  8965.   indicated by the "^" character. The generated version number is displayed
  8966.   to the standard output (-d) file. It is also used to update the Pascal
  8967.   source file constant (-psource).
  8968.  
  8969.   The second SetVersion command set the 'vers',2 resource (-t 'vers',
  8970.   -i 2). The version is set unconditionally to 3.0b1 and the long message
  8971.   string to "MPW 3.0b1". MPW 3.0b1 is the MPW release, and SetVersion
  8972.   is just one of the files that belong to this release.
  8973.  
  8974.   The last example illustrates how both 'vers' resources should be
  8975.   used. The 'vers',1 resource is the individual file version while
  8976.   the 'vers',2 is the version release of a product that "owns" the
  8977.   file. The last example also should give some idea of how to arrange
  8978.   makefiles, specifically makefile macro definitions, to make the version
  8979.   numbering automatic and general. The following example illustrates
  8980.   this. It is the actual macro definitions and the SetVersion calls
  8981.   used to build SetVersion itself. They are taken as is from SetVersion’s
  8982.   makefile.
  8983.  
  8984.   MPWversion = 3.0b1                # product release version
  8985.   Copyright = ©Apple Computer, Inc. # copyright notice
  8986.   ver2 = MPW {MPWversion}           # long msg string for 'ver',2
  8987.   ver1 = ^, {Copyright}             # long msg string for 'ver',1
  8988.   - - -
  8989.  
  8990.   SetVersionVer = -sv 3 -r          # SetVersion's component controls
  8991.   Stage = -stage rel -sb 0          # Stage used by tools in makefile
  8992.   - - -
  8993.  
  8994.   SetVersion {LinkedTools}SetVersion -psource {ToolsDir}SetVersion.p ∂
  8995.   {SetVersionVer} -t vers -i 1 {stage} -d ∂
  8996.                   -verstring "{ver1} 1984-1988, by Ira L. Ruben"
  8997.  
  8998.   SetVersion {LinkedTools}SetVersion -version {MPWversion} -t vers ∂
  8999.              -i 2 -verstring "{ver2}"
  9000.   - - -
  9001.  
  9002.   The macro definitions specify the common aspects of the build; that
  9003.   is,
  9004.  
  9005.     • {MPWVersion}—the MPW release (which can be changed by a Make -d
  9006.     option when Make is called).
  9007.  
  9008.     • {Copyright}—the copyright string (which is concatenated into
  9009.     the 'vers',1 long message string).
  9010.  
  9011.     • {ver1}—the long string for the 'vers',2 resource (note it uses
  9012.     the MPW release string—we could have used a "^" here), which
  9013.     is to be displayed at the top of the Finder’s Get Info window.
  9014.  
  9015.     • {ver2}—the long string for the 'vers',1 resource (here we do
  9016.     use the "^"), which is to be displayed as the tools’ individual
  9017.     version number (we use only version and revision numbers).
  9018.  
  9019.     • {SetVersionVer}—a macro that defines the numbering control
  9020.     for the individual tool (the makefile is used to make other tools
  9021.     so there is one of these for each individual tool made).
  9022.  
  9023.     • {Stage}—Used just to insure that only ver.rel is generated
  9024.     in the 'vers',1 resource.
  9025.  
  9026.   The two SetVersion calls are similar to the previous example, but
  9027.   here they are part of a makefile, and we use the macros.
  9028.  
  9029.   1 Commando only uses the SetVersion string resource if a "VersionDialog"
  9030.   is specified as part of the Commando resources. If omitted, Commando
  9031.   will look for a 'vers' resource(s).
  9032.  
  9033.   2 When Commando uses a 'vers' resource, it first will look for a
  9034.   'vers' ,1 resource, and if not present, a 'vers' ,2 resource. The
  9035.   short version string is displayed below the Do It button. Clicking
  9036.   this version number causes the long version string to be displayed
  9037.   in the "help" box. The two 'vers' resources as well as the strings
  9038.   they contain are described when the 'vers' resource format is described.
  9039.  
  9040.   3 The comparison of the BCD field is only valid if the version number
  9041.   components don’t exceed the limitations imposed by the resource.
  9042.   Specifically, the version and nonrelease values are limited to two
  9043.   BCD digits, while the revision and bug fix values are limited to
  9044.   one digit. Because of these limitations, SetVersion does not use
  9045.   the BCD value. SetVersion does, however, place the low-order digits
  9046.   of the actual version components (maintained in the short message)
  9047.   into the BCD fields. The BCD field is thus valid until the version
  9048.   counts exceed the corresponding BCD limitations.
  9049.  
  9050.   4 See the -t option for a summary of which options are valid as a
  9051.   function of which resource (SetVersion’s string or Finder’s 'vers'
  9052.   resource) is being manipulated.
  9053.  
  9054.   5 The country names are spelled exactly as specified in Inside Macintosh
  9055.   for the International Utilities.
  9056.  
  9057. æKY Shift
  9058. æC         Shift -- renumber command file positional parameters
  9059.  
  9060. Shift [number]
  9061.  
  9062. Status codes returned:
  9063.   0    Success.
  9064.   1    Syntax error.
  9065.  
  9066.                            Description
  9067.  
  9068.   Shift renames the command script positional parameters {number+1},
  9069.   {number+2}… to {1}, {2}, and so on. If number is not specified, the
  9070.   default value is 1. Parameter 0 (the command name) is not affected.
  9071.   The variables {Parameters}, {Parameters}, and {#} variables are also
  9072.   modified to reflect the new parameters.
  9073.  
  9074.  
  9075.                              Examples
  9076.  
  9077.   The following script repeats a command once for each parameter:
  9078.  
  9079.   ### Repeat - Repeat a command for several parameters ###
  9080.   #
  9081.   #         Repeat command parameter…
  9082.   #         Execute command once for each parameter in the
  9083.   #         parameter list. You can specify options by
  9084.   #         including them in quotes with the command name.
  9085.   #
  9086.   Set d {1}
  9087.   Loop
  9088.     Shift
  9089.     Break If {1} == ""
  9090.     {cmd} "{1}"
  9091.   End
  9092.  
  9093.   In the preceding example, the Shift command is used to step through
  9094.   the parameters. The Break command tells the loop when all the parameters
  9095.   have been used. You might, for example, use the following Repeat
  9096.   script to compile several C programs with progress information:
  9097.  
  9098.   Repeat 'C -p' Sample.c Count.c Memory.c
  9099.  
  9100.  
  9101.                              See also 
  9102.  
  9103.   "Parameters" in Chapter 5.
  9104.       
  9105. æKY ShowSelection
  9106. æC          ShowSelection -- place the selection within an editor window
  9107.  
  9108. ShowSelection [-t | -b | -c | -n lines | -l line] [window]
  9109.  -t                   # place first line of selection at top of window
  9110.  -b                   # place first line of selection at bottom of window
  9111.  -c                   # center the first line within the window
  9112.  -n lines             # place first line of selection lines from the top
  9113.  -l line              # place line at the top of window
  9114.  
  9115. æKY Shutdown
  9116. æC             Shutdown -- power down or restart the machine
  9117.  
  9118. Shutdown [-y | -n | -c] [-r]
  9119.  -y                  # save all modified windows (avoids dialog)
  9120.  -n                  # do not save any modified windows (avoids dialog)
  9121.  -c                  # cancel if a window needs to be saved (avoids dialog)
  9122.  -r                  # restart the machine
  9123.  
  9124. Status codes returned:
  9125.   1    Syntax error.
  9126.   2    Command aborted.
  9127.        Note: Shutdown cannot return a status of 0 because if there are no 
  9128.        errors the command never returns.
  9129.  
  9130.                            Description
  9131.  
  9132.   Shutdown quits MPW and then either shuts down or reboots the Macintosh.
  9133.   The default is shutdown. Before rebooting the computer, the system
  9134.   executes standard quit procedures, asking for confirmation to save
  9135.   modified files, close all windows, and so on.
  9136.  
  9137.     • Note: Under MultiFinder, Shutdown does not give other active
  9138.     applications the chance to save their documents.
  9139.  
  9140.  
  9141.                              Examples
  9142.  
  9143.   Shutdown -y
  9144.  
  9145.   Shuts down the machine, answering "Yes" to any dialogs such as those
  9146.   prompting to save files.
  9147.  
  9148.  
  9149.                              See also 
  9150.  
  9151.   Quit command.
  9152.  
  9153. æKY SizeWindow
  9154. æC                  SizeWindow -- set a window's size
  9155.  
  9156. SizeWindow  [h v] [window]
  9157.  h                       # window width (horizontal)
  9158.  v                       # window height (vertical)
  9159.  
  9160. Status codes returned:
  9161.   0    No errors.
  9162.   1    Syntax error (error in parameters).
  9163.   2    The specified window does not exist.
  9164.   3    The h v size specified is too big.
  9165.  
  9166.                            Description
  9167.  
  9168.   Sets the size of the specified window to be h by v pixels, where
  9169.   h and v are nonnegative integers referring to the horizontal and
  9170.   vertical dimensions, in that order. (Use a blank space to separate
  9171.   the numbers h and v on the command line.) The default window is the
  9172.   target (second from the front) window; a specific window can optionally
  9173.   be specified. If the size specified would cause the window to be
  9174.   too big for the screen, an error is returned.
  9175.  
  9176.  
  9177.                              Examples
  9178.  
  9179.   SizeWindow 200 200
  9180.  
  9181.   Makes the target window 200 pixels square in size.
  9182.  
  9183.   SizeWindow {Active}
  9184.  
  9185.   A SizeWindow command with no parameters displays the size of the
  9186.   specified window:
  9187.  
  9188.   SizeWindow 500 100 {Worksheet}
  9189.  
  9190.   Makes the Worksheet window 500 x 100 pixels in size.
  9191.  
  9192.  
  9193.                              See also 
  9194.  
  9195.   MoveWindow, RotateWindows, StackWindows, TileWindows, and ZoomWindow
  9196.   commands.
  9197.  
  9198. æKY Sort
  9199. æC                  Sort -- sort or merge lines of text
  9200.  
  9201. Sort [option…] [files…]
  9202.  -b                      # skip leading blanks of each field
  9203.  -check                  # check if input is sorted (exit code 5 if not).
  9204.  -d                      # sort fields as decimal numbers
  9205.  -f field[,field]        # specify fields to sort on (see below)
  9206.  -fs string              # specify field separator characters
  9207.  -l                      # convert to lowercase before comparison
  9208.  -merge                  # merge pre-sorted input files
  9209.  -o file                 # specify output file, allows sorting-in-place
  9210.  -p                      # print version and progress information
  9211.  -quote                  # handle fields with quotes
  9212.  -stdin                  # place-holder for standard input (acts like a file)
  9213.  -r                      # reverse order of comparison
  9214.  -t                      # sort fields as text (default)
  9215.  -u                      # convert to uppercase before comparison
  9216.  -unique                 # write only unique output lines
  9217.  -x                      # sort fields as hexadecimal numbers (leading '$'
  9218.                          #   or '0x' is ignored)
  9219.  
  9220.  The comma-separated field specifications (following -f) take the forms:
  9221.  
  9222.          [F][.C][-K][bdlqrtux]
  9223.      or  [F][.C][+N][bdlqrtux]
  9224.  
  9225.  'F' is a field number (0=whole line [default], 1=first word, 2=second word…).
  9226.  'C' is the starting column number (from 1), default=1.
  9227.  'K' is the ending column number >= C, default=infinite.
  9228.  'N' is the maximum number of characters in the field, default=infinite.
  9229.  Only one of '-K' or '+N' can be specified.
  9230.  
  9231.  The local modifier characters 'bdlqrtux' have the same meaning on a
  9232.  per-field basis as -b, -d, -l, -q, -r, -t, -u and -x (which take effect
  9233.  globally).
  9234.  
  9235. Status codes returned:
  9236.   0    No errors.
  9237.   1    Syntax error on command line.
  9238.   2    Any other error.
  9239.   4    Out of memory.
  9240.   5    Input is not sorted.
  9241.  
  9242.                            Description
  9243.  
  9244.   Sort sorts or merges the specified files and prints the result on
  9245.   the standard output. If no input files are specified, standard input
  9246.   is assumed.
  9247.  
  9248.   Fields and Field Specifications
  9249.  
  9250.   The -f option (see "Options" ) precedes a comma-separated list of
  9251.   field specifications. Lines are sorted by extracting and comparing
  9252.   the fields in the order specified until a comparison yields inequality.
  9253.   If a field exists in one line but not the other, the line that possesses
  9254.   the field wins. If neither line has a field, the lines are considered
  9255.   equal. Fields not sorted are output randomly (Sort is not a stable
  9256.   sort).
  9257.  
  9258.   Each of the field specifications takes one of the forms:
  9259.  
  9260.   [F][.C][-K][modifiers]
  9261.  
  9262.   [F][.C][+N][modifiers]
  9263.  
  9264.   F is a field number, C and -K are column numbers, and +N is a character
  9265.   count. Any of the items may be omitted, provided that at least one
  9266.   item appears. The numbers -K and +N are mutually exclusive. Spaces
  9267.   can appear anywhere in the specification (except within numbers),
  9268.   but they must be Shell-quoted.
  9269.  
  9270.   Fields are numbered from 1. A field is a string of characters surrounded
  9271.   by newlines or field separator characters (usually whitespace; see
  9272.   the -fs option). Typically field 1 would be the first word on the
  9273.   line, field 2 the second word, and so on. Field 0 represents the
  9274.   entire line and is the default if a field number is not specified.
  9275.   Field separator characters are treated as normal text (not separators)
  9276.   in field 0.
  9277.  
  9278.   Columns are numbered from 1. If .C is specified, it represents a
  9279.   starting offset into the field, taking into account the (file-dependent)
  9280.   varying width of tab characters, if necessary. .C defaults to 1 if
  9281.   it is not specified.
  9282.  
  9283.   If -K is specified it represents the last column to be included in
  9284.   the field. It defaults to infinity (the maximum K possible) if not
  9285.   specified. Except for field 0, fields are always terminated by field-separator
  9286.   characters, so a large K does not mean "the rest of the line."
  9287.  
  9288.   If +N is specified, it represents the number of characters to be
  9289.   included in the field (this differs from -K in that tabs are always
  9290.   counted as single characters). It defaults to infinity (the maximum
  9291.   N possible) if not specified.
  9292.  
  9293.   Here is a short description of all possible field specifications:
  9294.  
  9295.     F         The entirety of field F.
  9296.     F.C       Columns C…∞ in field F.
  9297.     F.C-K     Columns C…K in field F.
  9298.     F.C+N     N characters starting at column C in field F.
  9299.     F-K       Columns 1…K in field F.
  9300.     F+N       The first N characters in field F.
  9301.     .C        Columns C…∞ in the whole line.
  9302.     .C-K      Columns C…K in the whole line.
  9303.     .C+N      N characters starting at column C in the whole line.
  9304.     -K        Columns 1…K in the whole line.
  9305.     +N        The first N characters of the whole line.
  9306.  
  9307.   A field specification may be followed by one or more modifier characters:
  9308.  
  9309.     r         Reverse order of comparison (reverses -r).
  9310.     b         Ignore leading blanks (reverses -b).
  9311.     q         Interpret quotes when extracting field (reverses -quote).
  9312.     d x t l u Treat field as decimal (d), hexadecimal (x), normal text
  9313.               (t), lowercase text (l) or uppercase text (u). These modifiers are
  9314.               mutually exclusive.
  9315.  
  9316.   These modifiers override the corresponding command line options on
  9317.   a field-by-field basis (r, q, and b flip the meaning of -r, -quote,
  9318.   and -b).
  9319.  
  9320.   When sorting multiple files, each file can have its own tab setting.
  9321.   When comparing column-aligned fields, Sort correctly handles tabs
  9322.   of varying width, even when comparing records from different files.
  9323.  
  9324.  
  9325.                              Examples
  9326.  
  9327.   Sort Able -stdin Baker -o Output
  9328.  
  9329.   Sort the files Able, Baker, and the standard input, with output to
  9330.   file Output.
  9331.  
  9332.   Sort -x -f '2.2+8, 1tr' Frog
  9333.  
  9334.   Sort the file Frog. The first key to sort on consists of eight characters
  9335.   starting at the second column of the second field, treated as a hexadecimal
  9336.   number. The second key to sort on is merely the text of the first
  9337.   field, in reverse order.
  9338.  
  9339.   Sort -p -merge -u one two three infinity
  9340.  
  9341.   Merge the specified files, treating lowercase characters as uppercase.
  9342.   Print version and progress information.
  9343.  
  9344. æKY StackWindows
  9345. æC             StackWindows -- arrange windows diagonally
  9346.  
  9347. StackWindows [-h num] [-v num] [-r top,left,bottom,right] [-i] [windows…]
  9348.  -h num                  # horizontal offset between windows
  9349.  -v num                  # vertical offset between windows
  9350.  -r t,l,b,r              # rectangle in which to stack windows
  9351.  -i                      # include the worksheet
  9352.  windows…                # list of windows to tile
  9353.  
  9354. Status codes returned:
  9355.   0    No errors.
  9356.   1    Syntax error (in parameters).
  9357.  
  9358.                            Description
  9359.  
  9360.   Automatically sizes and moves all of the open Shell windows (except
  9361.   the Worksheet) so that they are staggered diagonally across the screen.
  9362.   Use StackWindows when selecting windows from the Window menu; this
  9363.   makes dealing with many open windows easier.
  9364.  
  9365.   If no windows are specified, all open Shell windows (except the Worksheet)
  9366.   are stacked up. Additionally you can specify the horizontal and vertical
  9367.   staggering constants; otherwise staggering defaults to five pixels
  9368.   horizontally and 20 pixels vertically. You can also include the Worksheet
  9369.   by using the -i option.
  9370.  
  9371.  
  9372.                              Examples
  9373.  
  9374.   StackWindows
  9375.  
  9376.   Stacks all of the Shell windows, excluding the Worksheet, in a neat
  9377.   and orderly fashion.
  9378.  
  9379.   StackWindows -i -v 20 -h 10 {active} {target}
  9380.  
  9381.   Stacks the top two windows, including the Worksheet, with a vertical
  9382.   spacing of 20 pixels and a horizontal spacing of 10 pixels.
  9383.  
  9384.  
  9385.                              See also 
  9386.  
  9387.   MoveWindow, RotateWindow, SizeWindow, TileWindows, and ZoomWindow
  9388.   commands.
  9389.       
  9390. æKY StreamEdit
  9391. æC              StreamEdit -- scriptable text editor
  9392.  
  9393. StreamEdit [option…] file…
  9394.     -d                      # delete lines (don't copy them)
  9395.     -e statements           # add 'statements' to the script
  9396.     -o file                 # direct output to file in a "safe" manner
  9397.     -p                      # print progress information
  9398.     -s file                 # specify a file containing a script to execute
  9399.     -set variable[=string]  # set the value of a variable
  9400.  
  9401.     A script consists of zero or more of:
  9402.     
  9403.         <address> <command>…
  9404.  
  9405.     Addresses take the forms (highest to lowest precedence):
  9406.     
  9407.         ( address )             # override precedence
  9408.         ! address               # match line not matching the address
  9409.         address1 && address2    # match line matching address1 AND address2
  9410.         address1 || address2    # match line matching address1 OR address2
  9411.         address1 , address2     # match address1…address2
  9412.         /regular expression/    # a line that matches the expression
  9413.         •                       # matches BEFORE the first line
  9414.         N                       # matches the Nth line
  9415.         $                       # matches the last line
  9416.         ∞                       # matches AFTER the last line
  9417.  
  9418.     A regular expression starting with 'ç' is case-sensitive.  Any '•' must
  9419.     follow the 'ç'.
  9420.  
  9421.     Commands are:
  9422.     
  9423.         Append <text>           # append text to append buffer
  9424.         Exit [status]           # exit with zero or specified status
  9425.         Change <text>           # set contents of edit buffer
  9426.         Delete                  # clear contents of edit buffer
  9427.         Insert <text>           # append text to insert buffer
  9428.         Next                    # proceed with next line
  9429.         Print <text>            # Print the text
  9430.              [-To file ]        #    directed to the specified file
  9431.              [-AppendTo file]   #    appended to the specified file
  9432.         Replace /pat/ <text>    # do replacement
  9433.                 [-c count]      # specify repeat count (N or ∞)
  9434.         Set variable <text>     # set variable's value
  9435.             [-a]                #    append to variable's current value
  9436.             [-i]                #    insert at front of variable's current value
  9437.         Option AutoDelete       # append "1,$ Delete" to script
  9438.     
  9439.     Where <text> consists of zero or more of:
  9440.     
  9441.         "a string"              # the specified text
  9442.         'a string'              # the specified text
  9443.         .                       # the current line (the edit buffer)
  9444.         variableName            # the contents of the named string variable
  9445.         ®N                      # an "®" variable set by a regular expression
  9446.         -from <filename>        # the next line from the file, where filename
  9447.                                 #    is a string or a variable name
  9448.         -n                      # suppress newline at end
  9449.  
  9450.     If <text> is empty, it defaults to "." (the current line).
  9451.             
  9452.                                        Description
  9453.                                                                                              
  9454. StreamEdit is an "offline" text editor similar to the Unix™ tool sed; it provides scriptable 
  9455. text matching and editing operations.  [It is not compatible with Unix™ sed or awk].  It is 
  9456. useful for making repetitive changes to files, for extracting information from text files, or 
  9457. as a filter.
  9458.  
  9459. StreamEdit takes a script and a set of input files (or standard input, if no input files are 
  9460. specified) and applies each statement in the script to each line of input, writing the output 
  9461. to standard output or the specified output file.
  9462.  
  9463. The script is specified by one or more -e or -s options.  If more than one script is 
  9464. specified, the resulting script is the concatenation of all the scripts.  If no script is 
  9465. specified (and -d is not specified), the script effectively defaults to
  9466.  
  9467.      1,$ Print
  9468.  
  9469. which has the effect of simply copying the input lines to the output.
  9470.  
  9471.  
  9472. A script consists of a series of statements of the form:
  9473.  
  9474.      address-expression command [ ; command … ]
  9475.  
  9476. Commands are separated by newlines or semi-colons.  All the commands following a 
  9477. particular address, up to the next address, are executed when the address matches.
  9478.  
  9479. A command takes the form:
  9480.  
  9481.      command-name [ text-arguments … ]
  9482.  
  9483. Arguments are terminated by newlines and semi-colons (while addresses may span 
  9484. multiple lines).
  9485.  
  9486. Address expressions, commands and command arguments are described below.
  9487.  
  9488.  
  9489. Empty lines are legal.  Comments begin with a sharp sign (#).  Semi-colons are equivalent 
  9490. to line breaks (unless they appear as the first character on a line), as in the Shell, and are 
  9491. used to terminate commands.  Newlines (outside of strings) may be escaped to extend an 
  9492. argument list.
  9493.  
  9494. If a script line contains a semi-colon in the first column, the entire line is treated as a 
  9495. comment by StreamEdit.  This allows you to write StreamEdit scripts that also contain 
  9496. MPW shell commands.  See the Examples section for more details.
  9497.  
  9498.                             Examples
  9499.                                                                                     
  9500.              Extracting the Leaf Part of a File Name
  9501.                                        
  9502. It is sometimes necessary to extract the leaf part of a complete file path name in a Shell 
  9503. script.  The StreamEdit expression:
  9504.  
  9505. /(≈:)*([¬:]*)®1/
  9506.  
  9507. sets the variable ®1 to the part of the file name following the last colon, or the whole file 
  9508. name if there it doesn't contain a colon.  It could be used in a Shell script as a filter:
  9509.  
  9510. # {MPW}Scripts:FilterLeaf
  9511. StreamEdit -d -e '/(≈:)*([¬:]*)®1/ print ®1'
  9512.  
  9513. For example:
  9514.  
  9515. Echo "The:I:Is:Silent:myFile" | FilterLeaf
  9516.  
  9517. would print:
  9518.  
  9519. myFile
  9520.  
  9521.  
  9522.                     Generating Inlines
  9523.                                                             
  9524. This is a script that generates MPW C or C++ inline function declarations from assembly 
  9525. language source.  It's far easier and less error-prone than hand-assembly or cut-and-paste; 
  9526. even though this script depends on the format of the listing file produced by the MPW 
  9527. Assembler, it is better to automate the process.
  9528.  
  9529. The script's usage is:
  9530.  
  9531. MakeCInline assemblyfile.a >outputFile
  9532.  
  9533. Given assembler input something like this:
  9534.  
  9535. ;+
  9536. ;  Inline Pascal string copy
  9537. ;
  9538. ;¥ void pascal_string_copy(char* src, char* dest);
  9539. ;
  9540. ;-
  9541.  proc
  9542.  movem.l (SP),A0-A1
  9543.  moveq   #0,D0
  9544.  move.b  (A1),D0
  9545.  bra.s   @2
  9546. @loop:   move.b   (A1)+,(A0)+
  9547. @2: dbra D0,@loop
  9548.  endproc
  9549.  
  9550. We want the filter to produce an inline declaration something like this:
  9551.  
  9552. void pascal_string_copy(char* src, char* dest) =
  9553. {0x4cef, 0x0300, 0x6b00, 0x1011, 0x6002, 0x10d9, 0x51c8, 0xfffc};
  9554.  
  9555. The character '¥' in the assembler comment marks the declaration; in principle any 
  9556. unique character or string can be used to flag the declaration.
  9557.  
  9558.  
  9559. The script has two parts; the first part contains MPW Shell commands, the rest of the 
  9560. script contains StreamEdit statements.
  9561.  
  9562. The MPW Shell part of the script is:
  9563.  
  9564. # MakeCInline -- make C assembly language inline declarations
  9565. ; asm "{1}" -l
  9566. ; StreamEdit -d -s "`which {0}`" "{1}".lst
  9567. ; Delete "{1}".lst "{1}".o
  9568. ; exit
  9569.  
  9570. It runs the assembler on the input file, producing a listing which is processed by the rest 
  9571. of the script.  Then the temporary files are removed and the MPW Shell part of the script 
  9572. exits; the Exit command ensures that the Shell doesn't execute any StreamEdit statements.
  9573.  
  9574. The invocation of StreamEdit here has an interesting hack; the name of the StreamEdit 
  9575. script to execute is, naturally, the name of the currently executing script.  So we use
  9576.  
  9577. `which {0}`
  9578.  
  9579. which expands into the name of the currently running shell script.
  9580.  
  9581.  
  9582. The rest of the file contains a StreamEdit script that processes the assembly listing 
  9583. produced above.  Here's an example of the assembler's listing output:
  9584.  
  9585. MC680xx Assembler - Ver 3.2d1          21-Nov-89  Page   1
  9586. Copyright Apple Computer, Inc. 1984-1989
  9587.  
  9588. Loc   F Object Code     Addr  MSource Statement
  9589.  
  9590.  case on
  9591.  ;+
  9592.  ;
  9593.  ; ¥ void pascal_string_copy(char* src, char* dest)
  9594.  ;
  9595.  ;-
  9596. 00000                       strcpy   proc   export
  9597. 00000   4CD7 0300            movem.l   (SP),A0-A1
  9598. 00004   7000                 moveq   #0,D0   
  9599. 00006   1011                 move.b   (A1),D0
  9600. 00008   6002        0000C    bra.s   @1
  9601. 0000A   10D9                @loop:   move.b   (A1)+,(A0)+
  9602. 0000C G 51C8 FFFC   0000A   @1:   dbra   D0,@loop
  9603. 00010                                endproc
  9604.  
  9605.                                 end
  9606.  
  9607. Elapsed time: 0.08 seconds.
  9608.  
  9609. Assembly complete - no errors found.  16 lines.
  9610.  
  9611.  
  9612.  
  9613. The opcodes we need are tantalizingly close … but embedded in goop that we need to 
  9614. strip away.  The first job is to extract the inline's declaration and copy it to the output.  
  9615. Hex constants must be separated by commas — we accomplish this with a variable, 
  9616. initially empty, that is set to a comma-and-space when a hex constant is emitted, so that a 
  9617. comma precedes every hex constant but the first one.
  9618.  
  9619. /;¥[ ∂t]*([¬;]*)®1/
  9620.  Print -n ®1 " =∂n{"
  9621.  Set PRECEEDING_COMMA ""
  9622.  Delete
  9623.  
  9624. The regular expression matches the inline declaration in the comment (which can be 
  9625. recognized by virtue of the marker string — "¥" — that we put there).  The text of the 
  9626. inline is extracted, omitting a possible trailing semicolon, and put into the variable ®1.  
  9627. The Print statement emits the inline declaration (in ®1) and extra stuff needed for C 
  9628. inline syntax.  The PRECEEDING_COMMA variable is set to empty, the line is deleted, 
  9629. and processing continues.
  9630.  
  9631.  
  9632. The inline declaration is terminated by an ENDP or an ENDPROC assembler directive:
  9633.  
  9634. /[ ∂t]ENDP/
  9635.  Print "};∂n"
  9636.  Delete
  9637.  
  9638. Next, totally uninteresting lines are deleted.  Examining the assembly listing, we note that 
  9639. the lines with the object code we need invariably contain a hex constant starting in the 
  9640. first column, several spaces (with an optional "G"), and at least one two-byte hex constant.  
  9641. We'll strip every line that doesn't meet these criteria, so there will be less noise to worry 
  9642. about.
  9643.  
  9644. !/•[0-9a-f]+ [ g] [0-9a-f]«4»/
  9645.  Delete
  9646.  
  9647. Then we simply delete any junk that precedes the hex constant we're interested in:
  9648.  
  9649. 1,$ Replace /[0-9a-f]+ [g ] /  ""
  9650.  
  9651. Now the line contains one word of assembler output that we can copy to the output:
  9652.  
  9653. /•([0-9a-f]«4»)®1 /
  9654.  Print -n PRECEEDING_COMMA "0x"®1
  9655.  Set PRECEEDING_COMMA ", "
  9656.  Replace // ""
  9657.  
  9658. We print an optional comma, followed by the hex constant itself.  Then we arrange for 
  9659. future constants to be preceded by a comma, and remove the constant from the front of 
  9660. the line.
  9661.  
  9662. Now we have a problem — there's no way to tell how many more constants have to be 
  9663. processed.  Furthermore, StreamEdit has no control structures for looping, so a count 
  9664. wouldn't help much anyway.  So we resort to a hack, namely, repeating the above code as 
  9665. many times as we're likely to ever need it for a single line of assembler output.
  9666.  
  9667. #
  9668. #  Convert remaining words
  9669. #  (I wish StreamEdit had looping!)
  9670. #
  9671. /•([0-9a-f]«4»)®1 /
  9672.  Print -n ", 0x"®1
  9673.  Replace // ""
  9674. /•([0-9a-f]«4»)®1 /
  9675.  Print -n ", 0x"®1
  9676.  Replace // ""
  9677. /•([0-9a-f]«4»)®1 /
  9678.  Print -n ", 0x"®1
  9679.  Replace // ""
  9680. /•([0-9a-f]«4»)®1 /
  9681.  Print -n ", 0x"®1
  9682.  Replace // ""
  9683.  
  9684. Examination of the assembler output shows that handling five constants on a line is more 
  9685. than enough.  However, if the assembler listing format changes, the script will break.
  9686.  
  9687.  
  9688.                       Unpacking Unix Shell Archives
  9689.                                                                   
  9690. This script unpacks a Unix shell archive, more commonly known as a shar file.  Shar files 
  9691. are used in the Unix community to gather text (say, the sources for a program, including 
  9692. its makefile) into a single file, suitable for transmittal by electronic mail or usenet.
  9693.  
  9694. Shar files typically have the form:
  9695.  
  9696. garbage at the beginning — mail headers and so forth
  9697. sed "s/^X//" >TheFile <<'END_OF_TheFile '
  9698. Xtext of the file
  9699. X  where each line
  9700. X    is preceded by an 'X'
  9701. END_OF_TheFile 
  9702. more files, similarly packed
  9703.  
  9704. The Unix shell and the tool sed cooperate to strip off the 'X's at the beginning of each 
  9705. line, and to direct the output to the correct file.  Unfortunately the MPW Shell does not 
  9706. have this kind of redirection, and StreamEdit is not sed, so we have to come up with our 
  9707. own solution.
  9708.  
  9709. To make matters worse, there is no single format for a shar file — in the Unix community 
  9710. it's "anything goes", as long as the standard Unix tools can unpack it.  A StreamEdit script 
  9711. to unpack an arbitrary shar file would have to closely emulate the Unix environment, 
  9712. which is rather difficult.  In practice, you'll have to tweak this script to handle different 
  9713. kinds of shar files.
  9714.  
  9715.  
  9716. The script starts with the usual MPW Shell commands to start up StreamEdit with the 
  9717. proper script, pass along the command-line parameters, and exit.  No surprises:
  9718.  
  9719. ; streamedit -d -s `which "{0}"` {parameters}
  9720. ; exit
  9721.  
  9722.  
  9723. The variable FILE holds the name of the current output file.  When we see a line beginning 
  9724. with "sed", we extract the output filename (possibly enclosed in quotes) and put it in the 
  9725. variable.
  9726.  
  9727. • Set FILE "DELETE.ME"         # for safety's sake
  9728.  
  9729. /•sed/ &&   (   />[ ∂t]*∂'([¬ ∂t]*)®1∂' /   # sed … >'quotedFile'
  9730.   ||
  9731.   />[ ∂t]*([¬ ∂t>]*)®1 /   # sed … >notQuotedFile
  9732.        )
  9733.   Set FILE ®1
  9734.   print "Extracting " FILE
  9735.  
  9736. For paranoia's sake, the FILE variable is initialized to "DELETE.ME", and the name of each 
  9737. file extracted is printed on standard output.
  9738.  
  9739. Extraction is simple — for every line beginning with an "X", the "X" is stripped off and the 
  9740. line is written to the current destination file.
  9741.  
  9742. /•X/
  9743.  replace // ""
  9744.  print -to FILE
  9745.    
  9746.                             See also
  9747.                                                                                           
  9748. Shell documentation on regular expressions.                                                                                          
  9749.    
  9750. æKY Target
  9751. æC              Target -- make a window the target window
  9752.  
  9753. Target name
  9754.  
  9755. Status codes returned:
  9756.   0    No errors.
  9757.   1    Error in parameters.
  9758.   2    The specified file does not exist.
  9759.   3    System error.
  9760.  
  9761.                            Description
  9762.  
  9763.   Makes window name the target window for editing commands (that is,
  9764.   the second window from the front). If window name isn’t already open,
  9765.   then file name is opened as the target window. If name doesn’t exist,
  9766.   an error is returned.
  9767.  
  9768.  
  9769.                              Examples
  9770.  
  9771.   Target Sample.a
  9772.  
  9773.   Makes the window Sample.a the target window.
  9774.  
  9775.  
  9776.                              See also 
  9777.  
  9778.   Open command.
  9779.  
  9780.   "Editing With the Command Language" in Chapter 5.
  9781.  
  9782. æKY TileWindows
  9783. æC          TileWindows -- arrange windows in a tiled fashion
  9784.  
  9785. TileWindows [-h | -v] [-r top,left,bottom,right] [-i] [windows…]
  9786.  -h                      # tile windows horizontally
  9787.  -v                      # tile windows vertically
  9788.  -r t,l,b,r              # rectangle in which to tile windows
  9789.  -i                      # include the worksheet
  9790.  windows…                # list of windows to tile
  9791.  
  9792. Status codes returned:
  9793.   0    No errors.
  9794.   1    Syntax error (error in parameters).
  9795.  
  9796.                            Description
  9797.  
  9798.   TileWindows automatically sizes and moves the specified Shell windows
  9799.   so that they are all visible on the screen at once. If no windows
  9800.   are specified, all open windows are tiled (except the Worksheet).
  9801.   Arranging your open windows like tiles and then zooming a selected
  9802.   window to full size makes dealing with many open windows much easier.
  9803.  
  9804.  
  9805.                              Examples
  9806.  
  9807.   TileWindows
  9808.  
  9809.   Arranges all of the Shell windows in a tile pattern, so that all
  9810.   are visible.
  9811.  
  9812.   TileWindows -h hd:new:main.c hd:new:foo.c
  9813.  
  9814.   Arranges the specified windows as two long horizontal strips.
  9815.  
  9816.   TileWindows -v {active} {target}
  9817.  
  9818.   Arranges the top two windows vertically.
  9819.  
  9820.  
  9821.                              See also 
  9822.  
  9823.   MoveWindow, RotateWindow, SizeWindow, StackWindows, and ZoomWindow
  9824.   commands.
  9825.  
  9826. æKY TransferCkid
  9827. æC  TransferCkid -- move Projector information from one file to another
  9828.  
  9829. TransferCkid sourceFile destinationFile 
  9830.  
  9831. Status codes returned:
  9832.   0    No errors.
  9833.   1    Syntax error.
  9834.   2    Error in processing.
  9835.  
  9836.                            Description
  9837.  
  9838.   Move the Projector 'CKID' resource from sourcefile to destinationfile.
  9839.  
  9840.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  9841.   symbols used in Projector commands.
  9842.  
  9843. æKY Translate
  9844. æC                  Translate -- translate characters
  9845.  
  9846. Translate [-p] [-s] src [dst] < file > output ≥ progress
  9847.     -p                    # write progress information to diagnostics
  9848.     -s                    # set font, font size, and tab setting of output
  9849.  
  9850. Status codes returned:
  9851.   0    Normal termination.
  9852.   1    Parameter or option error.
  9853.  
  9854.                            Description
  9855.  
  9856.   Standard input is copied to standard output, with input characters
  9857.   specified in the src (source) parameter string mapped into the corresponding
  9858.   characters specified by the dst (destination) parameter string; all
  9859.   other characters are copied as is. If dst is omitted, all characters
  9860.   represented by the src are deleted. If the dst string is shorter
  9861.   than the src, all characters in the src that would map to or beyond
  9862.   the last character in the dst are mapped into the last character
  9863.   in dst, and adjacent instances of such characters in the input are
  9864.   represented by a single instance of the last character in dst.
  9865.  
  9866.   Both src and dst are specified as a standard Shell character list
  9867.   but not enclosed in square brackets. Thus the src and dst are sequences
  9868.   of one or more characters (that is, an abcde) or a range of characters
  9869.   separated by a minus sign (that is, a–z, 0–9). Standard escape characters
  9870.   (such as ,
  9871.  
  9872.     • Note: Case sensitivity of letters specified in the src list
  9873.     are governed by the {CaseSensitive} Shell variable. If CaseSensitive
  9874.     is set to 1, then only letters specified in the src are mapped
  9875.     or deleted. If CaseSensitive is 0, then uppercase and lowercase
  9876.     letters not explicitly mapped into dst characters are mapped
  9877.     identically.
  9878.  
  9879.  
  9880.                              Examples
  9881.  
  9882.   translate a-z A-Z <origFile >ucFile
  9883.  
  9884.   Converts all lowercase letters in origFile to uppercase and writes
  9885.   the translated file to ucFile.
  9886.  
  9887.   translate 0-9 9 <origFile >outFile
  9888.  
  9889.   Converts each string of digits in origFile to the single digit 9
  9890.   in outFile.
  9891.  
  9892.   translate  
  9893.  
  9894.   Converts each run of blanks, tabs, or newline (return) characters
  9895.   in origFile to a single newline character in outFile. This effectively
  9896.   produces an output with just one word on each line. Note that the
  9897.   src string had to be quoted to specify the blank.
  9898.  
  9899.   translate ¬a-zA-Z    <origFile >outFile
  9900.  
  9901.   Removes all punctuation and isolates words by spaces on each line.
  9902.   Here we negated the src character list. Thus all characters except
  9903.   letters and newline characters are replaced with spaces.
  9904.  
  9905. æKY Unalias
  9906. æC                      Unalias -- remove aliases
  9907.  
  9908. Unalias [name…]
  9909.  
  9910. Status codes returned:   
  9911.   0    no errors.
  9912.  
  9913.                            Description
  9914.  
  9915.   Removes any alias definition associated with the alias name. (It
  9916.   is not an error if no definition exists for name.)
  9917.  
  9918.   s Caution If no names are specified, all aliases are removed.  s
  9919.  
  9920.   The scope of the Unalias command is limited to the current script;
  9921.   that is, aliases in enclosing scripts are not affected. If you are
  9922.   writing a script that is to be completely portable across various
  9923.   users’ configurations of MPW, you should place the command
  9924.  
  9925.   Unalias
  9926.  
  9927.   at the beginning of your script to make sure no unwanted substitutions
  9928.   occur.
  9929.  
  9930.  
  9931.                              Examples
  9932.  
  9933.   Unalias File
  9934.  
  9935.   Remove the alias "File". (This alias is defined in the Startup file.)
  9936.  
  9937.  
  9938.                              See also 
  9939.  
  9940.   Alias command.
  9941.  
  9942.   "Command Aliases" in Chapter 5.
  9943.  
  9944. æKY Undo
  9945. æC                     Undo -- undo the last edit
  9946.  
  9947. Undo [window]
  9948.  
  9949. Status codes returned:
  9950.   0    No errors.
  9951.   1    Syntax error (error in parameters).
  9952.   2    Any other error.
  9953.  
  9954.                            Description
  9955.  
  9956.   Undo is the scriptable equivalent of choosing Undo from the Edit
  9957.   menu to reverse the last editing operation. Undo without any parameters
  9958.   acts on the target (that is, the second from the front) window. Optionally
  9959.   a named window can be specified.
  9960.  
  9961.     • Note: Remember that Undo is maintained on a window-by-window
  9962.     basis. Therefore using this command will undo the last edit operation
  9963.     that was performed in the specified window, which may or may
  9964.     not be the last operation actually performed.
  9965.  
  9966.  
  9967.                              Examples
  9968.  
  9969.   Undo
  9970.  
  9971.   Reverses the last edit operation in the target window.
  9972.  
  9973.   Undo {Worksheet}
  9974.  
  9975.   Reverses the last edit operation in the Worksheet window.
  9976.  
  9977.  
  9978.                              See also 
  9979.  
  9980.   Cut, Copy, and Paste commands.
  9981.  
  9982. æKY Unexport
  9983. æC     Unexport -- remove variable definitions from the export list
  9984.  
  9985. Unexport [-r | -s | name…]   > unexports
  9986.  -r                      # generate Export commands for all unexported variables
  9987.  -s                      # print the names only
  9988.  
  9989. Status codes returned:
  9990.   0    No error.
  9991.   1    Syntax error.
  9992.  
  9993.                            Description
  9994.  
  9995.   Removes the specified variables from the list of exported variables.
  9996.   The list of exported variables is local to a script, so unexported
  9997.   variables are removed only from the local list.
  9998.  
  9999.   If no names are specified, a list of unexported variables is written
  10000.   to standard output. The default output of Unexport is in the form
  10001.   of Unexport commands.
  10002.  
  10003.   (A variable that is not exported is considered unexported.)
  10004.  
  10005.  
  10006.                              Examples
  10007.  
  10008.   Set SrcDir HD:source:
  10009.   Export SrcDir # SrcDir is available to scripts and tools
  10010.   …
  10011.   Unexport SrcDir
  10012.  
  10013.   Now the variable SrcDir is no longer available to scripts and tools.
  10014.  
  10015.   Unexport -r
  10016.   Export var1
  10017.   Export var2
  10018.   …
  10019.  
  10020.   This example lists all the variables that are not exported. To export
  10021.   them, simply select and execute all the export commands.
  10022.  
  10023.   To get a list of all the variables that have not been exported, execute
  10024.   this command:
  10025.  
  10026.   Unexport -s
  10027.   var1
  10028.   var2
  10029.   ...
  10030.   varx
  10031.  
  10032.  
  10033.                              See also 
  10034.  
  10035.   Set and Export commands.
  10036.  
  10037. æKY Unmark
  10038. æC               Unmark -- remove a marker from a window
  10039.  
  10040. Unmark name… window
  10041.  
  10042. Status codes returned:
  10043.   0    No errors.
  10044.   1    Syntax error.
  10045.   2    Error in processing.
  10046.   3    System error.
  10047.  
  10048.                            Description
  10049.  
  10050.   Unmark removes the marker(s) name… , from the list of markers available
  10051.   for window. When a window is the current active window, the Mark
  10052.   menu item(s) will be adjusted.
  10053.  
  10054.  
  10055.                              Examples
  10056.  
  10057.   Unmark `Markers` {Target}
  10058.  
  10059.   Removes all markers associated with the target window.
  10060.  
  10061.   Unmark Proc1 {Active}
  10062.  
  10063.   Removes the "Proc1" marker from the active window’s marker list.
  10064.   Because {Active} is by definition the current active window, the
  10065.   Mark menu is also adjusted to reflect the deletion of the "Proc1"
  10066.   marker.
  10067.  
  10068.   Limitation Unmark does not support Undo.
  10069.  
  10070.  
  10071.                              See also 
  10072.  
  10073.   "Markers" in Chapter 6.
  10074.  
  10075. æKY Unmount
  10076. æC                     Unmount -- unmount volumes
  10077.  
  10078. Unmount volume…
  10079.  
  10080. Status codes returned:
  10081.   0    The volume was successfully unmounted.
  10082.   1    Syntax error.
  10083.   2    An error occurred.
  10084.  
  10085.                            Description
  10086.  
  10087.   Unmounts the specified volumes. A volume name must end with a colon
  10088.   ( : ). If volume is a number without a colon, it’s interpreted as
  10089.   a disk drive number. The unmounted volumes cannot be referenced again
  10090.   until remounted. If you unmount the current volume (the volume containing
  10091.   the current directory), the boot volume becomes the current volume.
  10092.  
  10093.  
  10094.                              Examples
  10095.  
  10096.   Unmount Memos:
  10097.  
  10098.   Unmounts the volume titled Memos.
  10099.  
  10100.   Unmount 1 2
  10101.  
  10102.   Unmounts the volumes in drives 1 (the internal drive) and 2 (the
  10103.   external drive). (The command Eject 1 2 would unmount and eject the
  10104.   volumes.)
  10105.  
  10106.  
  10107.                              See also 
  10108.  
  10109.   Eject and Mount commands.
  10110.  
  10111. æKY UnmountProject
  10112. æC                 UnmountProject -- unmount projects
  10113.  
  10114. UnmountProject -a | Project…
  10115.  -a                      # unmount all mounted projects
  10116.  
  10117. Status codes returned:
  10118.   0    No errors.
  10119.   1    Syntax error.
  10120.   2    Error in processing.
  10121.   3    System error.
  10122.  
  10123.                            Description
  10124.  
  10125.   Unmount projects mounted under Projector.
  10126.  
  10127.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  10128.   symbols used in Projector commands.
  10129.  
  10130.  
  10131.                              Examples
  10132.  
  10133.   To unmount all mounted projects use:
  10134.  
  10135.   UnmountProject -a
  10136.  
  10137.   To unmount the projects MyProject and YourProject use:
  10138.  
  10139.   UnmountProject MyProject YourProject
  10140.  
  10141.  
  10142.                              See also 
  10143.  
  10144.   MountProject.
  10145.  
  10146. æKY Unset
  10147. æC              Unset -- remove Shell variable definitions
  10148.  
  10149. Unset [name…]
  10150.  
  10151. Status codes returned:
  10152.  0    no errors.
  10153.  
  10154.                            Description
  10155.  
  10156.   Removes any variable definition associated with name. (It’s not an
  10157.   error if no definition exists for name.)
  10158.  
  10159.   • Caution If no names are specified, all variable definitions are
  10160.   removed. This can have serious consequences. For example, the Shell
  10161.   uses the variable {Commands} to locate utilities and applications
  10162.   and uses several other variables to set defaults. The assembler and
  10163.   compilers use variables to help locate include files. (For details,
  10164.   see "Variables Defined in the Startup File" in Chapter 5 of the MPW
  10165.   manual.)
  10166.  
  10167.   The scope of the Unset command is limited to the current script;
  10168.   that is, variables in enclosing scripts are not affected.
  10169.  
  10170.  
  10171.                              Examples
  10172.  
  10173.   Unset CaseSensitive
  10174.  
  10175.   Removes the variable definition for {CaseSensitive}. This turns off
  10176.   case-sensitive searching for the editing commands.
  10177.  
  10178.  
  10179.                              See also 
  10180.  
  10181.   Set, Export, and Unexport commands.
  10182.  
  10183.   "Defining and Redefining Variables" in Chapter 5.
  10184.  
  10185. æKY UserVariables
  10186. æC     UserVariables -- uses Commando to set all the user variables
  10187.  
  10188. æKY Version
  10189. æC                Version -- print the version of the MPW Shell
  10190.  
  10191. æKY Volumes
  10192. æC                   Volumes -- list mounted volumes
  10193.  
  10194. Volumes [-l] [-q] [volume…]  > volumeList
  10195.  -l                      # long format (name, drive, size, free, files, dirs)
  10196.  -q                      # don't quote volume names with special characters
  10197.  
  10198. Status codes returned:
  10199.   0    No errors.
  10200.   1    Syntax error.
  10201.   2    No such volume.
  10202.  
  10203.                            Description
  10204.  
  10205.   For each volume named, Volumes writes its name and any other information
  10206.   requested to standard output. The output is sorted alphabetically.
  10207.   A volume name must end with a colon ( : )—if volume is a number without
  10208.   a colon, it’s interpreted as a disk drive number. If volume is not
  10209.   given, all mounted volumes are listed.
  10210.  
  10211.  
  10212.                              Examples
  10213.  
  10214.   Volumes -l
  10215.  
  10216.   will write information such as
  10217.  
  10218.   Name   Drive   Size    Free   Files  Dirs
  10219.   _____ ______  _____   _____  ______ _____
  10220.   HD:      3    19171K  14242K    290   33
  10221.  
  10222.   Files `Volumes 1`
  10223.  
  10224.   Lists the files on the disk in drive 1 (the built-in 3.5-inch disk
  10225.   drive).
  10226.  
  10227. æKY WhereIs
  10228. æC               WhereIs  -- find the location of a file
  10229.  
  10230. WhereIs [-c] [-d] [-v] [-s directory]… pattern
  10231.  -c                      # completely match filepattern
  10232.  -d                      # include directories
  10233.  -v                      # verbose output - put summary line at end
  10234.  -s directory            # starting directory/volume for search
  10235.  
  10236. Status codes returned:
  10237.   0    No errors.
  10238.   1    Syntax error.
  10239.   2    File system error during processing.
  10240.   3    No matches were found.
  10241.  
  10242.                            Description
  10243.  
  10244.   Use WhereIs to find the location of all files that contain pattern
  10245.   as part of their filename. You can use WhereIs to find files hidden
  10246.   in the directory tree. Pattern is a full or partial filename. For
  10247.   example, a pattern of "test" will match TestProg.c, test.c, and Work:OutputTest.
  10248.   WhereIs starts searching in the root directory of the default volume
  10249.   and searches the entire disk. To constrain the search to a portion
  10250.   of a disk, or to specify different disks or multiple disks, use the
  10251.   -s option. To list any directories that contain pattern, use the
  10252.   -d option. To constrain the search to files that completely match
  10253.   pattern, use the -c option. The -v option prints the number of items
  10254.   matched with pattern. Matching is not case sensitive, and regular
  10255.   expressions are not supported.
  10256.  
  10257.   WhereIs lists the full pathname of all files and directories found.
  10258.   Files that contain special characters are quoted.
  10259.  
  10260.  
  10261.                              Examples
  10262.  
  10263.   WhereIs test
  10264.  
  10265.   Find all files that have "test" in their filename. The output would
  10266.   be something like
  10267.  
  10268.   HD:MPW:test.c
  10269.   HD:MPW:test.c.o
  10270.   HD:MPW:TestMenu.c
  10271.   HD:MPW:TestProg.p
  10272.  
  10273.   WhereIs -c test.c
  10274.  
  10275.   Find files named test.c. The output (with the same files as the example
  10276.   above) would be
  10277.  
  10278.   HD:MPW:test.c
  10279.  
  10280.   WhereIs -d test
  10281.  
  10282.   Find all files or directories that have "test" in their leafname.
  10283.   The output would be
  10284.  
  10285.   HD:MPW:TestDir:
  10286.   HD:MPW:test.c
  10287.   HD:MPW:test.c.o
  10288.   HD:MPW:TestMenu.c
  10289.   HD:MPW:TestProg.p
  10290.  
  10291.   WhereIs -s HD:MPW -s Disk2:Work test
  10292.  
  10293.   Find all files that have "test" in their pathname. Search for the
  10294.   files starting in HD:MPW and also in Disk2:Work.
  10295.  
  10296. æKY Which
  10297. æC         Which -- determine which file the shell will execute
  10298.  
  10299. Which [-a] [-p] [name]  > file ≥ progress
  10300.  -a                      # report all commands named "name"
  10301.  -p                      # writes progress information to diagnostics
  10302.  
  10303. Status codes returned:
  10304.   0    No error.
  10305.   1    Syntax error.
  10306.   2    Command not found.
  10307.   3    Other error.
  10308.  
  10309.                            Description
  10310.  
  10311.   Determines which command the Shell will execute when command is entered.
  10312.   Which looks for commands defined by aliases, Shell built-in commands,
  10313.   and commands accessible through the Shell variable {Commands} (the
  10314.   same order the Shell uses). If command is not specified, all paths
  10315.   in the {Commands} variable will be written to standard output, one
  10316.   directory per line. The directories are listed in the order in which
  10317.   the Shell would search for commands. In this case the -a and -p options
  10318.   have no meaning.
  10319.  
  10320.  
  10321.                              Examples
  10322.  
  10323.   Which asm
  10324.  
  10325.   This command outputs something like - HD:MPW:Tools:asm. The Shell
  10326.   then executes hd:MPW:Tools:asm when given asm.
  10327.  
  10328.   Which -a makeit
  10329.   Alias makeit 'make > tmp; tmp'
  10330.   HD:MPW:Tools:makeit
  10331.   HD:MPW:Scripts:makeit
  10332.  
  10333.   In this case, there are three different "makeit" commands that the
  10334.   Shell could execute, as determined by current aliases and the {Commands}
  10335.   variable. The Shell executes the first one found (the alias).
  10336.  
  10337.   Which newfolder
  10338.  
  10339.   newfolder
  10340.  
  10341.   In this case, newfolder is a Shell built-in command.
  10342.  
  10343. æKY Windows
  10344. æC                      Windows  -- list windows
  10345.  
  10346. Windows [-q]
  10347.  -q                      # don't quote window names with special characters
  10348.  -o                      # list "Open" command lines for execution
  10349.  
  10350. Status codes returned:
  10351.   0    No error.
  10352.   1    Syntax error.
  10353.  
  10354.                            Description
  10355.  
  10356.   Writes the full pathname of each file currently in a window. The
  10357.   names are written to standard output, one per line, from backmost
  10358.   to frontmost.
  10359.  
  10360.  
  10361.                              Examples
  10362.  
  10363.   Windows
  10364.  
  10365.   Lists the pathnames of all open windows.
  10366.  
  10367.   Print {PrintOptions} `Windows`
  10368.  
  10369.   Prints the pathnames of the open windows, using the options specified
  10370.   by the {PrintOptions} variable. This example uses command substitution:
  10371.   Because the Windows command appears in backquotes (`…`), its output
  10372.   supplies the parameters to the Print command.
  10373.  
  10374.   Echo "Open `Windows` || Set Status 0" > SavedWindows
  10375.  
  10376.   Writes a script in the file SavedWindows that will reopen the current
  10377.   set of open windows. Notice how Echo is used to create the script.
  10378.   The conditional || execution operator restores the status to zero
  10379.   should an error occur while opening the remembered windows. This
  10380.   technique is used in the script Suspend to save the list of open
  10381.   windows.
  10382.  
  10383. æKY ZoomWindow
  10384. æC           ZoomWindow -- enlarge or reduce a window's size
  10385.  
  10386. ZoomWindow [-b | -s] [window]
  10387.  -b                      # zoom to full screen (big)
  10388.  -s                      # zoom back to regular size (small)
  10389.  
  10390. Status codes returned:
  10391.   0    No errors.
  10392.   1    Syntax error (error in parameters).
  10393.   2    The specified window does not exist.
  10394.  
  10395.                            Description
  10396.  
  10397.   Zooms the specified window according to the option specified. The
  10398.   default window is the target (second from the front) window; a specific
  10399.   window can optionally be specified. The -s option forces the window
  10400.   to zoom back to its small size. The -b option forces the window to
  10401.   zoom to its full size. If no option is specified, the window toggles
  10402.   to the other size. ZoomWindow without any options mimics the operation
  10403.   of clicking in the window’s zoom box. This command is especially
  10404.   valuable when used in conjunction with StackWindows or TileWindows.
  10405.  
  10406.                              Examples
  10407.  
  10408.   ZoomWindow
  10409.  
  10410.   Zooms the target window to full screen size if the window was originally
  10411.   in the small size.
  10412.  
  10413.   ZoomWindow -s {Worksheet}
  10414.  
  10415.   Zooms the Worksheet window back to its small size.
  10416.  
  10417.  
  10418.                              See also 
  10419.  
  10420.   MoveWindow, RotateWindows, SizeWindow, StackWindows, and TileWindows
  10421.   commands.
  10422.  
  10423.   {ZoomWindowRect} variable in Chapter 5.
  10424.  
  10425.   The "full size" window is normally the entire screen. You can change
  10426.   it (for example, prevent it from covering the disk and trash icons)
  10427.   by specifying a rectangle in the Shell variable {ZoomWindowRect}.
  10428.